QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#496412#7562. Except Oneno_RED_no_DEADWA 0ms3696kbC++20550b2024-07-28 09:25:322024-07-28 09:25:32

Judging History

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

  • [2024-07-28 09:25:32]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3696kb
  • [2024-07-28 09:25:32]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
using ll = long long;

const ll N = 1e6 + 1;
const ll M = 1e9 + 7;

ll powerMod(ll a, ll b, ll m) {
    ll res = 1;
    for (; b; a = a * a % m, b >>= 1)
        if (b & 1) res = res * a % m;
    return res;
}

ll p, k, t;

void doTest(ll testID) {
    cin >> p >> k >> t;
    cout << (0ll - powerMod(k, t, p) + p) % p;
}

signed main() {
    ios_base::sync_with_stdio(0); cin.tie(0);

    int test = 1; 
    // cin >> test;
    for (int _ = 1; _ <= test; _ ++) doTest(test);
}

详细

Test #1:

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

input:

7 5 3

output:

1

result:

ok 1 number(s): "1"

Test #2:

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

input:

11 6 7

output:

3

result:

ok 1 number(s): "3"

Test #3:

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

input:

3 2 1

output:

1

result:

ok 1 number(s): "1"

Test #4:

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

input:

596620183 516846890 38276329

output:

135352707

result:

ok 1 number(s): "135352707"

Test #5:

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

input:

382744931 85302262 235496559

output:

14577469

result:

ok 1 number(s): "14577469"

Test #6:

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

input:

659446013 641119314 378275666

output:

368821851

result:

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