QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#300349 | #7562. Except One | dozicc | WA | 0ms | 3520kb | C++14 | 384b | 2024-01-08 03:54:45 | 2024-01-08 03:54:46 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
long long stepen(long long broj, long long step, long long mod)
{
if(step==1)return broj;
long long res=stepen(broj, step/2, mod);
if(step%2==0)return (res*res)%mod;
return (broj*res*res)%mod;
}
int main()
{
long long p, k, t; cin>>p>>k>>t;
cout<<(stepen(-k, t, p)+p)%p<<endl;
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3472kb
input:
7 5 3
output:
1
result:
ok 1 number(s): "1"
Test #2:
score: 0
Accepted
time: 0ms
memory: 3520kb
input:
11 6 7
output:
3
result:
ok 1 number(s): "3"
Test #3:
score: 0
Accepted
time: 0ms
memory: 3476kb
input:
3 2 1
output:
1
result:
ok 1 number(s): "1"
Test #4:
score: -100
Wrong Answer
time: 0ms
memory: 3468kb
input:
596620183 516846890 38276329
output:
519404832
result:
wrong answer 1st numbers differ - expected: '135352707', found: '519404832'