2013年8月7日
摘要: #include #include int main(int argc, char* argv[]){ #ifdef __MYLOCAL freopen("in.txt","r",stdin); #endif int t,n; scanf("%d",&t); while(t--) { scanf("%d",&n); int all = 1, a = n % 10; while(n > 0) { n % 2 == 1 ? all = all * a % 10 : NULL; ... 阅读全文
posted @ 2013-08-07 21:33 lk1993 阅读(137) 评论(0) 推荐(0) 编辑
摘要: m = n^n ==> lg(m) = lg(n^n)==> lg(m) = n*lg(n)==> m = 10^(n*lg(n))对于 10^N = 10^123.456 = 10^(123+0.456) = 10^123 * 10^0.0.45610^123 的最高位为 '1',即 10^N 的最高位取决于n*lg(n) 的小数部位#include #include #include int main(int argc, char* argv[]){ #ifdef __MYLOCAL freopen("in.txt","r&q 阅读全文
posted @ 2013-08-07 21:17 lk1993 阅读(447) 评论(0) 推荐(0) 编辑
摘要: b 值大,取二分幂计算#include #include #define Mint main(int argc, char* argv[]){ #ifdef __MYLOCAL freopen("in.txt","r",stdin); #endif int a,b,c,t; while(scanf("%d%d",&a,&b) != EOF) { c = 1, t = a % 10; while(b > 0) { b % 2 == 1 ? c = c * t % 10 : NULL; ... 阅读全文
posted @ 2013-08-07 20:18 lk1993 阅读(171) 评论(0) 推荐(0) 编辑