QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#181207#3161. Another Coin Weighing Puzzlewarwolf#WA 1ms3840kbC++20288b2023-09-16 16:38:012023-09-16 16:38:02

Judging History

你现在查看的是最新测评结果

  • [2023-09-16 16:38:02]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3840kb
  • [2023-09-16 16:38:01]
  • 提交

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);
}

詳細信息

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'