标签:memory for const log efi map space app algo
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 21240 Accepted Submission(s): 9420
1 #include<iostream> 2 #include<cstdio> 3 #include<cmath> 4 #include<cstring> 5 #include<algorithm> 6 #include<queue> 7 #include<map> 8 #include<set> 9 #include<vector> 10 #include<cstdlib> 11 #include<string> 12 #define eps 0.000000001 13 typedef long long ll; 14 typedef unsigned long long LL; 15 using namespace std; 16 const int N=10000+100; 17 int a[N]; 18 int c1[N],c2[N]; 19 int main(){ 20 int t[N]={0,1,2,5};; 21 while(scanf("%d%d%d",&a[1],&a[2],&a[3])!=EOF){ 22 if(a[1]==0&&a[2]==0&&a[3]==0)break; 23 int maxx=a[1]*1+a[2]*2+a[3]*5; 24 memset(c2,0,sizeof(c2)); 25 memset(c1,0,sizeof(c1)); 26 for(int i=0;i<=a[1];i++)c1[i]=1; 27 for(int i=2;i<=3;i++){ 28 for(int j=0;j<=maxx;j++) 29 for(int k=0;k<=a[i]*t[i]&&k+j<=maxx;k=k+t[i]){ 30 c2[j+k]=c2[j+k]+c1[j]; 31 } 32 for(int j=0;j<=maxx;j++){ 33 c1[j]=c2[j]; 34 c2[j]=0; 35 36 } 37 } 38 for(int i=0;i<=maxx+5;i++){ 39 if(c1[i]==0){ 40 cout<<i<<endl; 41 break; 42 } 43 44 } 45 } 46 }
标签:memory for const log efi map space app algo
原文地址:http://www.cnblogs.com/Aa1039510121/p/6344929.html