标签:gre ble 分组 chm inpu chmod show family input
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 7304 Accepted Submission(s): 5016
1 #include <bits/stdc++.h> 2 using namespace std; 3 int main() 4 { 5 int T,n,m; 6 int a,b,c; 7 while(cin>>T) 8 { 9 while(T--) 10 { 11 cin>>n>>m; 12 int ans=0; 13 for(a=0;a<=m;a++) 14 { 15 for(b=0;b<=m/2;b++) 16 { 17 for(c=0;c<=m/5;c++) 18 if(a*1+b*2+c*5==m&&(a!=0||b!=0||c!=0)&&a+b+c==n) 19 ans++; 20 } 21 } 22 cout<<ans<<endl; 23 } 24 } 25 return 0; 26 }
标签:gre ble 分组 chm inpu chmod show family input
原文地址:http://www.cnblogs.com/ECJTUACM-873284962/p/6391665.html