QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#297439#7562. Except OneSaanteye#WA 1ms3608kbC++14635b2024-01-04 14:12:362024-01-04 14:12:36

Judging History

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

  • [2024-01-04 14:12:36]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3608kb
  • [2024-01-04 14:12:36]
  • 提交

answer

#include <bits/stdc++.h>
//#include <vector>
using namespace std;

void solve() {

}
#define  int long long
int p,k,t;
int mod;
int qpow(int a,int b)
{
    int res=1;
    while(b)
    {
        if(b&1) res=res*a%mod;
        a=a*a%mod;
        b>>=1;
    }
    return res;
}
signed main() {
    ios::sync_with_stdio(false); cin.tie(0);
    cin>>p>>k>>t;
    mod=p;
    int w=(1+p-1)*(p-1)%mod*qpow(2,mod-2)%mod;
    w=((w-k)%mod+mod)%mod;
    w=w*qpow(k,t-1)%mod;
    cout<<w;
}
//1 2 3 4 5 6
//1 2 3 4 5
//1 2 3 4 6
//1 2 3 5 6
//1 2 4 5 6
//1 3 4 5 6
//2 3 4 5 6
//t=2
//p=7
//k(0-k(1+3+4+5+6))

详细

Test #1:

score: 100
Accepted
time: 1ms
memory: 3448kb

input:

7 5 3

output:

1

result:

ok 1 number(s): "1"

Test #2:

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

input:

11 6 7

output:

3

result:

ok 1 number(s): "3"

Test #3:

score: 0
Accepted
time: 1ms
memory: 3440kb

input:

3 2 1

output:

1

result:

ok 1 number(s): "1"

Test #4:

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

input:

596620183 516846890 38276329

output:

135352707

result:

ok 1 number(s): "135352707"

Test #5:

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

input:

382744931 85302262 235496559

output:

14577469

result:

ok 1 number(s): "14577469"

Test #6:

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

input:

659446013 641119314 378275666

output:

368821851

result:

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