QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#278867 | #5661. Multi-Ladders | dat# | WA | 14ms | 9084kb | Python3 | 424b | 2023-12-07 21:37:54 | 2023-12-07 21:37:55 |
Judging History
answer
t = int(input())
mod = 10**9 + 7
def pow_mod(n, k):
if k == 0:
return 1
elif k == 1:
return n
else:
pow_2 = pow_mod(n, k//2)
if k % 2 == 1:
return (pow_2 * pow_2 * k) % mod
else:
return (pow_2 * pow_2) % mod
while t:
t -= 1
a, b, c = [int(e) for e in input().split()]
print(a*(pow_mod(b*c, a)) % (10**9 + 7))
详细
Test #1:
score: 100
Accepted
time: 14ms
memory: 9076kb
input:
1 2 3 3
output:
162
result:
ok single line: '162'
Test #2:
score: -100
Wrong Answer
time: 9ms
memory: 9084kb
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 9 0 419904000 42 0 208927575 147098745 575383709 882 740000014 90102436 204559542 140000049 999999937 300000007 999999307 0 655415525 673568113
result:
wrong answer 2nd lines differ - expected: '6', found: '9'