摘要:/******************************************************************** created: 2014/03/17 18:53 filename: main.cpp author: Justme0 (http://blog.csdn.net/justme0) purpose: code project 内存管理*********************************************************************/#define _CRT_S...
阅读全文
摘要:#include using namespace std;templateT Pow(T x, Int n){ T r(1); // 应是含幺半群的幺元 while (n != 0) { if (n & 0x1 == 1) { r *= x; } n >>= 1; x *= x; } return r;}template T PowBoost(T x, Int n){ T r(n & 0x1 ? x : 1); while ((n >>= 1) != 0)...
阅读全文
摘要:1 /******************************************************************** 2 created: 2014/03/16 22:56 3 filename: main.cpp 4 author: Justme0 (http://blog.csdn.net/justme0) 5 6 purpose: C++ 中数串互转、进制转换的类 7 *********************************************************************/ 8 9 #def...
阅读全文
摘要:1 int gcd(int a, int b) {2 return b == 0 ? a : gcd(b, a % b);3 }
阅读全文