QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#278867#5661. Multi-Laddersdat#WA 14ms9084kbPython3424b2023-12-07 21:37:542023-12-07 21:37:55

Judging History

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

  • [2023-12-07 21:37:55]
  • 评测
  • 测评结果:WA
  • 用时:14ms
  • 内存:9084kb
  • [2023-12-07 21:37:54]
  • 提交

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

Details

Tip: Click on the bar to expand more detailed information

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'