Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
109859 胡海峰老师 统计硬币 C++ Wrong Answer 2 MS 268 KB 417 2025-02-13 09:43:21

Tests(0/1):


Code:

#include <iostream> using namespace std; int main(){ int n,m,t; int a,b,c,tot; cin>>t; for(int i=1;i<=t;i++) { cin>>n>>m; tot = 0; for(a=0;a<=n;a++) for(b=0;b<=n;b++) { c = n -a-b; if(a*1+b*2+c*5 == m) { //cout<< a <<"-"<<b<<"-"<<c<<endl; tot++; } } cout<<tot; } return 0; } /* Input 2 3 5 4 8 Output 1 2 */


Run Info:

------Input------
20 5 10 8 20 3 6 2 4 10 26 11 27 1 1 1 2 2 2 1 5 5 25 100 250 1000 3000 26 120 9 30 12 27 7 25 27 54 32 100 4 13
------Answer-----
2 2 1 1 3 3 1 1 1 1 1 21 167 1 2 3 1 7 6 1
------Your output-----
22113311111211671231761