QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#102557#5661. Multi-Laddersir101#WA 2ms3316kbC++17575b2023-05-03 14:38:072023-05-03 14:38:10

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-05-03 14:38:10]
  • 评测
  • 测评结果:WA
  • 用时:2ms
  • 内存:3316kb
  • [2023-05-03 14:38:07]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
typedef pair<int,int>PII;
typedef pair<string,int>PSI;
const int N=2e5+5,INF=0x3f3f3f3f,Mod=1e9+7;

const double eps=1e-6;
typedef long long ll;

ll ksm(ll a,ll b){
    ll res=1;
    while(b){
        if(b&1)res=(res*a)%Mod;
        a=a*a%Mod;
        b>>=1%Mod;
    }
    return res;
}
int t;
ll n,m,k;

int main(){
    ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);
    cin>>t;
    while(t--){
        cin>>n>>k>>m;
        ll s=n*k%Mod*ksm(m,n+1)%Mod;
        cout<<s<<'\n';
    }
    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 2ms
memory: 3316kb

input:

1
2 3 3

output:

162

result:

ok single line: '162'

Test #2:

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

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
27
0
61440
84
0
412653697
272821726
135802470
999999629
294000000
999930007
589337905
314000007
999999307
490000000
490
0
49
291544900

result:

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