#include #include #include #define maxn 100 #define maxm 10000 #define maxscore 10001 struct node { long g; long num[maxn+1]; }iden[maxm+1]; long score[maxn+1],cost[maxn+1]; long f[maxm+1],total[maxm+1]; long max(long a,long b) { if (a>b) return a; else return b; } long min(long a,long b) { if (a>b) return b; else return a; } bool pan(long j,long k) { long l; for (l=1;l=cost[i];j--,k--) if (f[k]!=-1 && (f[k]+score[i]>f[j] || (f[k]+score[i]==f[j] && total[k]+i=0;i--) if (f[i]>f[j] || (f[i]==f[j] && total[i]