摘要:
费马大定理:a^n + b^n = c^n在n > 2无解 只考虑n为1和2的情况 n为1,则b=1,c=a+1 n为2,构造勾股数:a是奇数时,tmp = a / 2; b = (tmp + 1) * tmp * 2; c = b + 1; 举例:5、12、13. a是偶数时,tmp = a / 阅读全文
摘要:
String 大数加法模板 阅读全文
摘要:
主要还是找规律,然后大数相乘 阅读全文
摘要:
#include #include #include #include #include #include #include #include #include #include #include using namespace std; #define LL long long const int N=1010000; void solv(int n,int &l,int &r,int &le... 阅读全文
摘要:
#include #include #include #include #include #include #define LL long long using namespace std; LL egcd(LL a,LL b,LL &x,LL &y) { if(b==0) { x=1; y=0; return a; } ... 阅读全文
摘要:
#include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define LL long long LL dp[55][55],num[55]; LL dfs(i... 阅读全文
摘要:
#include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define LL long long LL dp[45][45][3],num[45]; LL df... 阅读全文
摘要:
#include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define LL long long LL dp[45][3],num[45]; LL dfs(in... 阅读全文