Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
100348 | 汤弘毅 | 统计硬币 | C++ | Wrong Answer | 1 MS | 276 KB | 301 | 2024-12-07 16:09:47 |
#include <iostream> using namespace std; int main(){ int n; cin>>n; int t; int p; for(int i=1;i<=n;i++){ int a,b; cin>>a>>b; t=0; for(int j=1;j<=a;j++){ for(int k=1;k<=a-j;k++){ p = a-j-k; if(j*1+k*2+p*5==b){ t = t+1; } } } cout<<t; } }
------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-----
11001200000211661121641