QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#473722 | #5546. Sharing Bread | yzkkai# | WA | 0ms | 3704kb | C++20 | 610b | 2024-07-12 13:36:32 | 2024-07-12 13:36:33 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
using LL = long long;
const int P = 998244353;
inline void solve() {
LL n, m;
cin >> n >> m;
auto fp = [&](LL x, LL y) -> LL {
LL res = 1;
for (; y; y >>= 1, x = (x * x) % P) {
if (y & 1) {
res *= x;
res %= P;
}
}
return res;
};
cout << fp(n + 1, m - 1) * (n - m + 1) << '\n';
return;
}
signed main() {
cin.tie(0)->sync_with_stdio(0);
int t = 1;
while (t--)
solve();
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3576kb
input:
4 3
output:
50
result:
ok single line: '50'
Test #2:
score: 0
Accepted
time: 0ms
memory: 3636kb
input:
10 1
output:
10
result:
ok single line: '10'
Test #3:
score: 0
Accepted
time: 0ms
memory: 3624kb
input:
2 2
output:
3
result:
ok single line: '3'
Test #4:
score: 0
Accepted
time: 0ms
memory: 3632kb
input:
1 1
output:
1
result:
ok single line: '1'
Test #5:
score: 0
Accepted
time: 0ms
memory: 3640kb
input:
277 277
output:
124662617
result:
ok single line: '124662617'
Test #6:
score: 0
Accepted
time: 0ms
memory: 3612kb
input:
426 1
output:
426
result:
ok single line: '426'
Test #7:
score: 0
Accepted
time: 0ms
memory: 3616kb
input:
200000 1
output:
200000
result:
ok single line: '200000'
Test #8:
score: 0
Accepted
time: 0ms
memory: 3704kb
input:
200000 200000
output:
950017432
result:
ok single line: '950017432'
Test #9:
score: -100
Wrong Answer
time: 0ms
memory: 3576kb
input:
200000 100000
output:
71265943552309
result:
wrong answer 1st lines differ - expected: '280947286', found: '71265943552309'