[此贴子已经被作者于2018-3-20 23:03编辑过]
#include<stdio.h> #include<math.h> #include<assert.h> unsigned fun( unsigned ); int main( void ) { unsigned s; scanf("%u",&s); printf("%u\n",fun(s)); return 0; } unsigned fun( unsigned s ) { unsigned d; assert(s-1<1e6); d=sqrt(s); return 2*(d+ceil(1.*s/d)); }
[此贴子已经被作者于2018-3-21 00:14编辑过]