QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#757802 | #9627. 算术 | electricstick# | WA | 0ms | 3916kb | C++17 | 739b | 2024-11-17 13:42:02 | 2024-11-17 13:42:02 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
int a[11];
int main()
{
int T;
scanf("%d",&T);
while(T--)
{
for(int i=1;i<=9;i++)
scanf("%d",&a[i]);
int c=min(a[1],a[2]);
a[1]-=c;a[2]-=c;a[3]+=c;
if(a[1]==1)
{
for(int i=2;i<9;i++)
{
if(a[i]!=0){a[i]--,a[i+1]++;break;}
}
a[1]=0;
}
if(a[1]>0)
{
if(a[1]%3==0)a[3]+=a[1]/3,a[1]=0;
else if(a[1]%3==1)
{
a[3]+=a[1]/3-1;
a[1]=4;
a[2]+=2;
a[1]=0;
}
else
{
a[3]+=a[1]/3;
a[2]++;
a[1]=0;
}
}
long long ans=1;
for(int i=2;i<=9;i++)
{
for(int j=1;j<=a[i];j++)
ans=ans*i%998244353;
}
printf("%lld\n",ans);
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3916kb
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 9 81 90553232 143532368
result:
wrong answer 4th lines differ - expected: '10', found: '9'