QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#747820 | #9627. 算术 | Lazy_boy# | WA | 0ms | 3552kb | C++20 | 1.1kb | 2024-11-14 18:22:30 | 2024-11-14 18:22:31 |
Judging History
answer
#include<bits/stdc++.h>
#define int long long
#define endl '\n'
#define pii std::pair<int ,int>
#define fix(x) std::fixed << std::setprecision(x)
const int inf = 1e17 + 50, MAX_N = 1e5 + 50, mod = 998244353;
void solve() {
std::vector<int> a(11, 0);
for(int i = 0; i < 9; i++) {
std::cin >> a[i + 1];
}
int mi = std::min(a[1], a[2]);
a[1] -= mi, a[2] -= mi, a[3] += mi;
a[3] += a[1] / 3, a[1] %= 3;
if (a[1] == 2) {
a[2]++;
} else if (a[1] == 1) {
for(int i = 2; i <= 9; i++) {
if (a[i]) {
a[i]--;
a[i + 1]++;
break;
}
}
}
int res = 1;
for(int i = 2; i <= 9; i++) {
while (a[i]--) {
res = res * i % mod;
}
}
std::cout << res << endl;
}
signed main() {
std::ios::sync_with_stdio(false);
std::cin.tie(nullptr), std::cout.tie(nullptr);
int Lazy_boy_ = 1;
std::cin >> Lazy_boy_;
while (Lazy_boy_--) solve();
return 0;
}
/*
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
*/
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3552kb
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'