QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#181185 | #3161. Another Coin Weighing Puzzle | warwolf# | WA | 0ms | 3948kb | C++20 | 312b | 2023-09-16 16:25:11 | 2023-09-16 16:25:12 |
Judging History
answer
#include <bits/stdc++.h>
#define maxn 100086
using namespace std;
int m, k;
const int p = 998244353;
int main(){
scanf("%d%d", &m, &k);
int ans = 1;
for(int i = 1;i <= m;i++) ans = 1ll * ans * 3 % p;
ans = (ans + p - 1) % p;
ans = 1ll * ans * min(m, k) % p;
printf("%d", (ans + 1) % p);
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3856kb
input:
2 1
output:
9
result:
ok single line: '9'
Test #2:
score: 0
Accepted
time: 0ms
memory: 3948kb
input:
2 2
output:
17
result:
ok single line: '17'
Test #3:
score: -100
Wrong Answer
time: 0ms
memory: 3856kb
input:
10000 10000
output:
55422034
result:
wrong answer 1st lines differ - expected: '689223145', found: '55422034'