QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#796562 | #9627. 算术 | Catbiscuit# | WA | 0ms | 3672kb | C++20 | 622b | 2024-12-01 21:02:00 | 2024-12-01 21:02:00 |
Judging History
answer
#include<bits/stdc++.h>
#define int long long
using namespace std;
int T;
int a[101],ans;
signed main(){
cin>>T;
while(T--){
ans=1;
for(int i=1;i<=9;i++)cin>>a[i];
if(a[1]<=a[2]){
a[3]+=a[1];
a[2]-=a[1];
a[1]=0;
}else{
a[3]+=a[2];
a[1]-=a[2];
a[2]=0;
a[3]+=a[1]/3;
a[1]%=3;
}
if(a[1]==2)a[2]=1,a[1]=0;
if(a[1]==1){
for(int i=3;i<=9;i++){
if(a[i]){
a[i]--;
a[i+1]++;
a[1]=0;
break;
}
}
}
for(int i=2;i<=9;i++){
for(int j=1;j<=a[i];j++){
ans*=i;
ans%=998244353;
}
}
cout<<ans<<endl;
}
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3672kb
input:
7 5 3 0 0 0 0 0 0 0 4 1 1 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 2 99 88 77 66 55 44 33 22 11 100 90 80 70 60 50 40 30 20
output:
54 108 1 1 9 90553232 143532368
result:
wrong answer 4th lines differ - expected: '10', found: '1'