QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#261050#7562. Except Onefxxx#WA 1ms3352kbC++17335b2023-11-22 17:38:072023-11-22 17:38:07

Judging History

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

  • [2023-11-22 17:38:07]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3352kb
  • [2023-11-22 17:38:07]
  • 提交

answer

#include<bits/stdc++.h>
#define LL long long
#define For(i,a,b) for(int i=(a);i<=(b);i++)
using namespace std;
LL mi(LL x,int y,int p){
    LL ans=1;
    while (y){
        if (y&1) ans=ans*x%p;
        x=x*x%p;
        y>>=1;
    }
    return ans;
}
int main(){
    int p,k,t;cin>>p>>k>>t;
    cout<<(p-mi(k,t,p))%p;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

7 5 3

output:

1

result:

ok 1 number(s): "1"

Test #2:

score: 0
Accepted
time: 0ms
memory: 3328kb

input:

11 6 7

output:

3

result:

ok 1 number(s): "3"

Test #3:

score: 0
Accepted
time: 0ms
memory: 3296kb

input:

3 2 1

output:

1

result:

ok 1 number(s): "1"

Test #4:

score: 0
Accepted
time: 0ms
memory: 3304kb

input:

596620183 516846890 38276329

output:

135352707

result:

ok 1 number(s): "135352707"

Test #5:

score: 0
Accepted
time: 0ms
memory: 3316kb

input:

382744931 85302262 235496559

output:

14577469

result:

ok 1 number(s): "14577469"

Test #6:

score: -100
Wrong Answer
time: 1ms
memory: 3324kb

input:

659446013 641119314 378275666

output:

368821851

result:

wrong answer 1st numbers differ - expected: '290624162', found: '368821851'