QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#796562#9627. 算术Catbiscuit#WA 0ms3672kbC++20622b2024-12-01 21:02:002024-12-01 21:02:00

Judging History

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

  • [2024-12-01 21:02:00]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3672kb
  • [2024-12-01 21:02:00]
  • 提交

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'