Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
152362 陈棋 统计硬币 C++ Wrong Answer 890 MS 272 KB 456 2026-04-25 16:19:11

Tests(0/1):


Code:

#include<iostream> using namespace std; int main(){ int m,n,t,x=0,y=0,z=0; cin>>t; int sum[t]; for(int i=0;i<t;i++){ cin>>n>>m; for(x=0;x<n;x++){ for(y=0;y<n;y++){ for(z=0;z<n;z++){ if(x==n){ x=0; } if(y==n){ y=0; } if(z==n){ z=0; } if(x+2*y+5*z==m){ sum[i]+=1; } } } } } for(int i=0;i<t;i++){ cout<<sum[i]-1<<endl; } return 0; }


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-----
413285636 32778 4607047 -1 413285615 32789 413285599 32765 72704 -1 16777227 1893 200019 135 1351991311 278036442 4195073 118 204 2