摘要: 【原题链接】 k太大,hash数组开不下,用了map判圈。View Code 1000+ms 1 #include <stdio.h> 2 #include <string.h> 3 #include <map> 4 using namespace std; 5 6 typedef long long LL; 7 8 LL cal(int n, LL &v, LL &ans) 9 {10 v = v * v;11 int L = 0;12 LL tmp = v;13 while(tmp)14 {15 L ++;16 ... 阅读全文
posted @ 2012-11-06 15:18 芒果布丁 阅读(325) 评论(0) 推荐(0)
摘要: 1 //适用于正整数2 template <class T>3 inline void scan_d(T &ret) {4 char c; ret=0;5 while((c=getchar())<'0'||c>'9');6 while(c>='0'&&c<='9') ret=ret*10+(c-'0'),c=getchar();7 } 1 //适用于正负整数 2 template <class T> 3 inline bool scan_d(T 阅读全文
posted @ 2012-11-06 11:45 芒果布丁 阅读(195) 评论(0) 推荐(0)