|
|
back to board#include <stdio.h> #include <math.h> long int n, k, hour; double x, y; int main(void) { scanf("%ld%ld", &n, &k); if (n == 1) { printf("0\n"); return 0; } n--; x = floor(log(k)/log(2)) + 1; y = pow(2, x) - 1; n -= y; hour = x; hour += n / k; if (n % k != 0) hour++; printf("%ld\n", hour); return 0; } What the fucking test. I test this program on sophisticated tests but vsio katu pod xvost. :-P if you find your mistake, please tall me. I got WA#3 first, but now - AC. Try K>N into your program. |
|
|