QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#759732#9627. 算术Baiyu0123#WA 0ms3596kbC++20841b2024-11-18 11:36:172024-11-18 11:36:19

Judging History

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

  • [2024-11-18 11:36:19]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3596kb
  • [2024-11-18 11:36:17]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
const int maxn=1e5+1000,mod=998244353;
int a[maxn];
int main() {
	ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
	int T;
	cin>>T;
	while (T--) {
		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 {
			int x=(a[1]+2*a[2]);
			if (x%3==0) a[3]+=x/3,a[2]=0;
			else if (x==1) {
				for (int i=3;i<=9;i++) {
					if (a[i]) {
						a[i]--;a[i+1]++;
						break;
					}
				}
			}
			else if (x%3==2) a[3]+=x/3,a[2]=1;
			else a[3]+=x/3-1,a[2]=2;
			a[1]=0;
		}
		long long ans=1;
		for (int i=1;i<=10;i++) {
			if (a[i]) while (a[i]--) ans=ans*i%mod;
		}
		cout<<ans<<'\n';
	}
}
/*
7
5 3 0 0 0 0  0 0  0
 3 41110 000 0
 4 10000 000 0
 5 10000 000 1
 6 10000 000 2
 7 9988776655 44332211
 8 10090 80 706050403020
*/

详细

Test #1:

score: 0
Wrong Answer
time: 0ms
memory: 3596kb

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
10
9
90553232
143532368

result:

wrong answer 5th lines differ - expected: '90', found: '9'