摘要:
题目链接:http://lightoj.com/volume_showproblem.php?problem=1031#include#include#include#includeusing namespace std;const int maxn = 105;int dp[maxn][maxn]; //dp[i][j] 表示先手从i到j比后手多的分差。int sum[maxn],a[maxn];int N;int main(){ // freopen("E:\\acm\\input.txt","r",stdin); int T; cin>> 阅读全文
摘要:
题目链接:http://lightoj.com/volume_showproblem.php?problem=1030#include#include#include#includeusing namespace std;const int maxn = 105;const int INF = 0x3f3f3f3f;double dp[maxn];int a[maxn];int main(){ //freopen("E:\\acm\\input.txt","r",stdin); int T; cin>>T; for(int cas=1;cas 阅读全文
摘要:
题目链接:http://lightoj.com/volume_showproblem.php?problem=1027#include#include#include#includeusing namespace std;int sum,ans,n,m;int Gcd(int a,int b){ if(a%b == 0) return b; return Gcd(b,a%b);}int main(){ //freopen("E:\\acm\\input.txt","r",stdin); int T; cin>>T; for(int cas=1 阅读全文
摘要:
题目链接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3329参考网址:http://blog.csdn.net/morgan_xww/article/details/6775853#include#include#include#includeusing namespace std;const int maxn = 525;double A[maxn],B[maxn];int sta[maxn],icnt;int n,k1,k2,k3,a,b,c;int main(){ //freopen("E:\\ac 阅读全文
摘要:
题目链接:http://poj.org/problem?id=2096#include#include#include#includeusing namespace std;const int maxn = 1005;const int INF = 0x3f3f3f3f;double dp[maxn][maxn];int main(){ int n,s; cin>>n>>s; for(int i=n;i>=0;i--) for(int j=s;j>=0;j--) if(i == n && j == s) dp[n][s] = 0,dp[n+1 阅读全文
摘要:
题目链接:http://poj.org/problem?id=1080#include#include#include#includeusing namespace std;const int maxn = 105;const int INF = 0x3f3f3f;int dp[maxn][maxn];int A[maxn],B[maxn];int mymap[6][6] = { {0, 0, 0, 0, 0, 0}, {0,5,-1,-2,-1,-3 }, {0,-1,5,-3,-2,-4 ... 阅读全文
摘要:
题目链接:http://poj.org/problem?id=2479#include#include#include#includeusing namespace std;const int maxn = 50005;const int INF = 0x3f3f3f3f;int dp1[maxn];int dp2[maxn];int a[maxn];int N;int main(){ int T; cin>>T; while(T--){ scanf("%d",&N); for(int i=1;i=1;i--){ dp2[i]... 阅读全文