COGS 2687 討厭整除的小明
阿新 • • 發佈:2017-05-13
void lan problem pid http cst 聯通 oid pri
二次聯通門 : COGS 2687 討厭整除的小明
/* cogs 2687 討厭整除的小明 打表出奇跡..
考場時看了一下樣例就感覺有非常鬼畜的做法。。
手搞幾組數據做法就出來了。。。
2333 */ #include <cmath> #include <cstdio> void read (long long &now) { now = 0; register char word = getchar (); while (word < ‘0‘ || word > ‘9‘) word= getchar (); while (word <= ‘9‘ && word >= ‘0‘) { now = now * 10 + word - ‘0‘; word = getchar (); } } int main (int argc, char *argv[]) { freopen ("ming.in", "r", stdin); freopen ("ming.out", "w", stdout); long long T; read (T); long longN; while (T--) { read (N); N = log2 (N) + 1; printf ("%lld\n", N); } return 0; }
COGS 2687 討厭整除的小明