QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#215846 | #7562. Except One | solemntee | WA | 0ms | 3960kb | C++17 | 329b | 2023-10-15 13:58:32 | 2023-10-15 13:58:33 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int mod;
ll poww(ll a,ll b){
ll t=1;
while(b){
if(b&1)t=t*a%mod;
a=a*a%mod;
b>>=1;
}
return t;
}
int main()
{
int k,t;
scanf("%d%d%d",&mod,&k,&t);
printf("%d",(2*mod-poww(k,t))%mod);
}
详细
Test #1:
score: 100
Accepted
time: 0ms
memory: 3956kb
input:
7 5 3
output:
1
result:
ok 1 number(s): "1"
Test #2:
score: 0
Accepted
time: 0ms
memory: 3912kb
input:
11 6 7
output:
3
result:
ok 1 number(s): "3"
Test #3:
score: 0
Accepted
time: 0ms
memory: 3912kb
input:
3 2 1
output:
1
result:
ok 1 number(s): "1"
Test #4:
score: 0
Accepted
time: 0ms
memory: 3892kb
input:
596620183 516846890 38276329
output:
135352707
result:
ok 1 number(s): "135352707"
Test #5:
score: 0
Accepted
time: 0ms
memory: 3836kb
input:
382744931 85302262 235496559
output:
14577469
result:
ok 1 number(s): "14577469"
Test #6:
score: -100
Wrong Answer
time: 0ms
memory: 3960kb
input:
659446013 641119314 378275666
output:
368821851
result:
wrong answer 1st numbers differ - expected: '290624162', found: '368821851'