QOJ.ac
QOJ
The 2nd Universal Cup Finals is coming! Check out our event page, schedule, and competition rules!
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#102543 | #5661. Multi-Ladders | wakakaka# | WA | 2ms | 3380kb | C++17 | 704b | 2023-05-03 14:32:24 | 2023-05-03 14:32:30 |
Judging History
answer
#include <iostream>
#include <algorithm>
#include <vector>
#include <map>
#define endl '\n'
#define int long long
using namespace std;
const int N = 2e5+10 , M = 1e6+10 , mod = 1e9+7;
int k[N];
int n,m,x;
int ksm(int base,int power) {
int ans=1;
while(power) {
if(power & 1) ans = ans * base % mod;
power >>= 1;
base = base * base % mod;
}
return ans;
}
void solve(){
int d;
cin >> n >> m >> d;
n = n % mod * m % mod;
cout << ksm(d,d) % mod * n %mod << endl;
}
signed main(){
ios::sync_with_stdio(0);
cin.tie(0) , cout.tie(0);
int T = 1;
cin >> T ;
while(T--) solve();
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 2ms
memory: 3380kb
input:
1 2 3 3
output:
162
result:
ok single line: '162'
Test #2:
score: -100
Wrong Answer
time: 0ms
memory: 3276kb
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 81 30 120 84 22 164706328 471875334 999999440 999999629 361379995 999996577 235170028 823446690 490 411723345 896665418 49 49 117936606
result:
wrong answer 2nd lines differ - expected: '6', found: '81'