二次联通门 : 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 long N; while (T--) { read (N); N = log2 (N) + 1; printf ("%lld\n", N); } return 0; }
时间: 2024-10-29 08:59:29