Run ID | 作者 | 问题 | 语言 | 测评结果 | 分数 | 时间 | 内存 | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|---|
2738 | A班-何泓霏 | 班级就餐 | C++ | 解答错误 | 0 | 1 MS | 252 KB | 548 | 2024-12-21 11:15:17 |
using namespace std; int main(){ int n; cin>>n; int a[n]; int temp=0; for(int i=0;i<n;i++) { cin>>a[i]; } for(int i=0;i<n;i++) { if(a[i]==1) { cout<<40<<endl; } else if(a[i]==2) { cout<<70<<endl; } else if(a[i]>=3) { int temp=a[i]%3; int sum=(a[i]-temp)/3; if(temp==1) { cout<<sum*90+40<<endl; } else if(temp=2) { cout<<sum*70+40<<endl; } else if(temp==7) { cout<<sum*(3*90)+40<<endl; } } } return 0; }
11
75
11
17
46
57
57
14
36
43
54
51
1790
250
390
1390
1370
1370
320
880
1300
1300
1230
2250
340
520
1390
1710
1710
430
1080
1300
1620
1530
exit code: 0, checker exit code: 0