QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#796561#9628. 骰子Catbiscuit#WA 0ms3708kbC++20622b2024-12-01 21:01:432024-12-01 21:01:44

Judging History

你现在查看的是最新测评结果

  • [2024-12-01 21:01:44]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3708kb
  • [2024-12-01 21:01:43]
  • 提交

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'