QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#526036 | #5661. Multi-Ladders | solar_express# | WA | 16ms | 10660kb | Python3 | 398b | 2024-08-21 10:02:24 | 2024-08-21 10:02:24 |
Judging History
answer
T = int(input())
mod = 1000000007
for _ in range(T):
n,k,l = map(int, input().split())
coef = ((l-2)**2+l-1) % mod
b = (l-1)**2%mod
u = (k//2)
base = u if b == 1 else (pow(b,u,mod)-1) * pow(b-1,-1,mod) % mod
if k & 1:
base = base * (l-1) % mod
else:
base += l
base = base * l * (l-2) % mod
print(base * pow(coef, (n-1)*k, mod) % mod)
詳細信息
Test #1:
score: 100
Accepted
time: 16ms
memory: 10576kb
input:
1 2 3 3
output:
162
result:
ok single line: '162'
Test #2:
score: -100
Wrong Answer
time: 9ms
memory: 10660kb
input:
20 2 3 3 1 3 3 10 3 0 10 3 2 1 21 2 1 22 0 2000 15000 2000 12000 30000 200000 1000000000 3 3 2 1000000000 3 2 3 100000000 1000000000 1000000000 10 1000000000 3 100000000 2 1000000000 100000000 1 1000000000 10 1 1000000000 100000000 1 1000 100000000 1000000000 1000000000 0 1000000000 1000000000 1 100...
output:
162 6 0 0 0 0 237094719 798470915 52489881 469328707 176686901 402619467 558243892 264608352 693054219 972715672 169402569 0 1000000005 501278814
result:
wrong answer 7th lines differ - expected: '349400141', found: '237094719'