摘要:
快速幂#include#include#include#include#includeusing namespace std;long long n,MOD;long long cal(long long a,long long b,long long mod){ long long c=1;... 阅读全文
posted @ 2015-07-17 17:56
Fighting_Heart
阅读(136)
评论(0)
推荐(0)
摘要:
矩阵快速幂#include#include#include#includeusing namespace std;const int maxn=15;const int MOD=9973;int n,k;struct Matrix{ int matrix[maxn][maxn]; Mat... 阅读全文
posted @ 2015-07-17 14:24
Fighting_Heart
阅读(155)
评论(0)
推荐(0)
摘要:
快速幂。只保存末位。快速幂的第一个题。#include#include#include#includeusing namespace std;int main(){ int T; scanf("%d",&T); while(T--) { int n; ... 阅读全文
posted @ 2015-07-17 12:31
Fighting_Heart
阅读(106)
评论(0)
推荐(0)
摘要:
二维完全背包,理解似乎还不够全面,过几天回来再看看这题。#include#include#include#includeusing namespace std;const int maxn=30;long long x[maxn],y[maxn],v[maxn];long long dp[1111]... 阅读全文
posted @ 2015-07-17 10:39
Fighting_Heart
阅读(129)
评论(0)
推荐(0)
摘要:
简单的钱币兑换问题,就是钱的种类多了一点,完全背包。#include#includeint main (){ int i,j,dp[125]; memset(dp,0,sizeof(dp)); dp[0]=1; for(i=1; i<=120; i++) for... 阅读全文
posted @ 2015-07-17 07:46
Fighting_Heart
阅读(118)
评论(0)
推荐(0)

浙公网安备 33010602011771号