QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#475121 | #8833. Equalizer Ehrmantraut | ucup-team3646# | AC ✓ | 2055ms | 10736kb | Python3 | 241b | 2024-07-13 11:29:39 | 2024-07-13 11:29:40 |
Judging History
answer
mod=998244353
def fpow(x,k):
res=1
while k:
if k&1:
res=res*x%mod
x=x*x%mod
k>>=1
return res
N,M=map(int,input().split())
ans=(2*M+1)*fpow(M,N)
for p in range(1,M+1):
ans-=2*fpow(p,N)
print(ans%mod)
这程序好像有点Bug,我给组数据试试?
详细
Test #1:
score: 100
Accepted
time: 5ms
memory: 10620kb
input:
1 3
output:
9
result:
ok 1 number(s): "9"
Test #2:
score: 0
Accepted
time: 3ms
memory: 10608kb
input:
2 2
output:
10
result:
ok 1 number(s): "10"
Test #3:
score: 0
Accepted
time: 14ms
memory: 10640kb
input:
69 42
output:
608932821
result:
ok 1 number(s): "608932821"
Test #4:
score: 0
Accepted
time: 14ms
memory: 10524kb
input:
102 156
output:
748401290
result:
ok 1 number(s): "748401290"
Test #5:
score: 0
Accepted
time: 142ms
memory: 10632kb
input:
4646 95641
output:
89806680
result:
ok 1 number(s): "89806680"
Test #6:
score: 0
Accepted
time: 418ms
memory: 10732kb
input:
42849 215151
output:
242217237
result:
ok 1 number(s): "242217237"
Test #7:
score: 0
Accepted
time: 1938ms
memory: 10636kb
input:
786416 794116
output:
472898000
result:
ok 1 number(s): "472898000"
Test #8:
score: 0
Accepted
time: 1794ms
memory: 10736kb
input:
963852 789456
output:
353211048
result:
ok 1 number(s): "353211048"
Test #9:
score: 0
Accepted
time: 862ms
memory: 10692kb
input:
696969 424242
output:
787990158
result:
ok 1 number(s): "787990158"
Test #10:
score: 0
Accepted
time: 252ms
memory: 10576kb
input:
1000000 123456
output:
533491028
result:
ok 1 number(s): "533491028"
Test #11:
score: 0
Accepted
time: 2055ms
memory: 10576kb
input:
1000000 1000000
output:
572586375
result:
ok 1 number(s): "572586375"
Test #12:
score: 0
Accepted
time: 1687ms
memory: 10620kb
input:
123456 1000000
output:
486967129
result:
ok 1 number(s): "486967129"
Test #13:
score: 0
Accepted
time: 15ms
memory: 10632kb
input:
789456 1
output:
1
result:
ok 1 number(s): "1"
Test #14:
score: 0
Accepted
time: 14ms
memory: 10572kb
input:
852516 2
output:
148946358
result:
ok 1 number(s): "148946358"
Test #15:
score: 0
Accepted
time: 243ms
memory: 10604kb
input:
1 953646
output:
40087733
result:
ok 1 number(s): "40087733"
Test #16:
score: 0
Accepted
time: 13ms
memory: 10616kb
input:
3 7686
output:
278212472
result:
ok 1 number(s): "278212472"
Extra Test:
score: 0
Extra Test Passed