QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#219858#5661. Multi-LaddersZIhan#WA 0ms3660kbC++20642b2023-10-19 19:12:102023-10-19 19:12:11

Judging History

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

  • [2023-10-19 19:12:11]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3660kb
  • [2023-10-19 19:12:10]
  • 提交

answer

#include<bits/stdc++.h>
#define int long long
#define endl '\n'
#define IO ios::sync_with_stdio(0),cin.tie(0); 
const int mod = 1e9 + 7;
using namespace std;
int powm(int x,int y){
    int ret=1;
    while(y){
        if(y%2==1){
            ret=ret*x%mod;
        }
        y>>=1;
        x=x*x%mod;
    }
    return ret;
}
signed main(){
    IO
    int t;
    cin>>t;
    while(t--){
        int n,k,l;
        cin>>n>>k>>l;
        int xx = powm(l*l-3*l+3, (n-1)*k);
        int yy = powm(l-1,k-1);
        int zz = powm(powm((1-l+mod)%mod,k-2), mod-2) + l - 1;
        cout<< xx*yy%mod*zz%mod<<'\n';
    }

}

詳細信息

Test #1:

score: 100
Accepted
time: 0ms
memory: 3656kb

input:

1
2 3 3

output:

162

result:

ok single line: '162'

Test #2:

score: -100
Wrong Answer
time: 0ms
memory: 3660kb

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
349400141
861628955
52489881
53690844
543241858
218103365
993022479
900135985
693053429
883715672
80402569
0
0
873441033

result:

wrong answer 8th lines differ - expected: '243010659', found: '861628955'