QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#526035 | #5661. Multi-Ladders | solar_express# | WA | 12ms | 10648kb | Python3 | 415b | 2024-08-21 10:01:48 | 2024-08-21 10:01:49 |
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
print(base)
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)
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 12ms
memory: 10648kb
input:
1 2 3 3
output:
1 162
result:
wrong answer 1st lines differ - expected: '162', found: '1'