QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#677582 | #5661. Multi-Ladders | Forever_Young# | WA | 0ms | 3936kb | C++23 | 731b | 2024-10-26 12:59:33 | 2024-10-26 12:59:34 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=1;i<=n;i++)
#define pb push_back
#define mp make_pair
#define data dataa
using LL=long long;
using ULL=unsigned long long;
using LD=long double;
#define gcd(x,y) __gcd(unsigned(x),unsigned(y))
const int MOD=int(1e9)+7;
int mypow(int x,LL n){int res=1;for(;n;n>>=1,x=LL(x)*x%MOD)if(n&1)res=LL(res)*x%MOD;return res;}
int main()
{
int T;
for(scanf("%d",&T);T--;)
{
int n,k,l;
scanf("%d%d%d",&n,&k,&l);
if(l<=1){puts("0");continue;}
int ans=(mypow(l-1,k)+((k&1)?-1:1)*(l-1)+MOD)%MOD;
ans=LL(ans)*mypow((LL(l)*l-3ll*l+3)%MOD,LL(n-1)*k);
printf("%d\n",ans);
}
return 0;
}
詳細信息
Test #1:
score: 100
Accepted
time: 0ms
memory: 3888kb
input:
1 2 3 3
output:
162
result:
ok single line: '162'
Test #2:
score: -100
Wrong Answer
time: 0ms
memory: 3936kb
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 -1626819653 1439133850 -1242477394 82319999 1805988288 -1013150056 -1547861568 1733901280 693053429 883715672 80402569 0 0 -1389725352
result:
wrong answer 7th lines differ - expected: '349400141', found: '-1626819653'