QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#751000 | #9627. 算术 | Dylan114514 | WA | 0ms | 3832kb | C++14 | 687b | 2024-11-15 16:40:06 | 2024-11-15 16:40:07 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
const int mod = 998244353;
int main() {
int t;
cin >> t;
int ans = 1;
while (t--) {
vector<int> a(12, 0);
for (int i = 1; i <= 9; ++i)
cin >> a[i];
while (a[1] >= 2 && a[1] > a[2]) {
a[1] -= 2, a[2]++;
}
for (int i = 2; i <= 9; ++i) {
if (a[1] == 0)
break;
int ad = min(a[1], a[i]);
a[1] -= ad, a[i] -= ad, a[i + 1] += ad;
}
for (int i = 1; i <= 10; ++i) {
ans %= mod;
if (a[i]) {
for (int j = 1; j <= a[i]; ++j) {
ans = (ans * i) % mod;
}
}
}
cout << ans << endl;
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3832kb
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 5832 5832 58320 5248800 754712454 -323628052
result:
wrong answer 2nd lines differ - expected: '108', found: '5832'