QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#181207 | #3161. Another Coin Weighing Puzzle | warwolf# | WA | 1ms | 3840kb | C++20 | 288b | 2023-09-16 16:38:01 | 2023-09-16 16:38:02 |
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);
if(m == 1) return printf("3"), 0;
int ans = 8 * k + 1;
for(int i = 1;i <= m - 2;i++) ans = 1ll * ans * 3 % p;
printf("%d", ans);
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 1ms
memory: 3840kb
input:
2 1
output:
9
result:
ok single line: '9'
Test #2:
score: 0
Accepted
time: 1ms
memory: 3804kb
input:
2 2
output:
17
result:
ok single line: '17'
Test #3:
score: -100
Wrong Answer
time: 1ms
memory: 3628kb
input:
10000 10000
output:
375799262
result:
wrong answer 1st lines differ - expected: '689223145', found: '375799262'