标签:
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 12875 Accepted Submission(s): 6548
#include<stdio.h>
#include<string.h>
int money[10010],m[3]={150,200,350};
int main(){
int T,n;
scanf("%d",&T);
while(T--){
scanf("%d",&n);
memset(money,0,sizeof(money));
for(int i=0;i<3;++i){
for(int j=m[i];j<=n;j++)if(money[j-m[i]]+m[i]>money[j])money[j]=money[j-m[i]]+m[i];
}
printf("%d\n",n-money[n]);
}
return 0;
}
标签:
原文地址:http://www.cnblogs.com/handsomecui/p/4625876.html