QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#736579#5661. Multi-LaddersSanguineChameleon#WA 11ms10568kbPython3356b2024-11-12 11:49:342024-11-12 11:49:36

Judging History

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

  • [2024-11-12 11:49:36]
  • 评测
  • 测评结果:WA
  • 用时:11ms
  • 内存:10568kb
  • [2024-11-12 11:49:34]
  • 提交

answer

x=int(input())

mod = int(1e9+7)

for i in range(x):
    n,k,lamb = map(int,input().split())
    x = lamb-1

    ladder = pow(lamb-1 + (lamb-2)**2,n-1,mod)
    all_lads = pow(ladder,k,mod)

    k_polyg = ((pow(-x,n-1,mod)-1)*pow(mod-x-1,mod-2,mod))%mod
    k_polyg = (x*(x+1)*k_polyg)%mod

    ans = (k_polyg*all_lads)%mod
    print(ans)


Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 11ms
memory: 10568kb

input:

1
2 3 3

output:

162

result:

ok single line: '162'

Test #2:

score: -100
Wrong Answer
time: 10ms
memory: 10512kb

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
0
0
2
0
0
619159556
44174210
103570820
415637863
304930780
218103365
294935167
29649047
0
0
0
0
0
311752813

result:

wrong answer 2nd lines differ - expected: '6', found: '0'