QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#796561 | #9628. 骰子 | Catbiscuit# | WA | 0ms | 3708kb | C++20 | 622b | 2024-12-01 21:01:43 | 2024-12-01 21:01:44 |
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: 3708kb
input:
2 2
output:
2 2
result:
wrong answer 1st lines differ - expected: '24', found: '2'