QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#211930#7562. Except OneUNos_maricones#WA 1ms3808kbC++14660b2023-10-12 23:48:212023-10-12 23:48:22

Judging History

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

  • [2023-10-12 23:48:22]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3808kb
  • [2023-10-12 23:48:21]
  • 提交

answer

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

#define ff first
#define ss second
#define pb push_back

typedef long long ll;
typedef pair <int,int> pii;

int mul ( int a, int b, int mod ) { return (ll(a)*b)%ll(mod); }

int fastPow ( int b, int e, int mod ) {
    if ( e == 1 ) return b;
    if ( e == 0 ) return 1;
    if ( e % 2 == 1 ) return mul ( b, fastPow ( b, e-1, mod ), mod );
    int mid = mul ( b, e/2, mod );
    return mul ( mid, mid, mod );
}

int main () {
        
    #ifndef LOCAL
    #endif

    int p, k, t;

    scanf ( "%d%d%d", &p, &k, &t );

    printf ( "%d\n", fastPow ( p-k, t, p ) );

    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

7 5 3

output:

1

result:

ok 1 number(s): "1"

Test #2:

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

input:

11 6 7

output:

3

result:

ok 1 number(s): "3"

Test #3:

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

input:

3 2 1

output:

1

result:

ok 1 number(s): "1"

Test #4:

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

input:

596620183 516846890 38276329

output:

82359785

result:

wrong answer 1st numbers differ - expected: '135352707', found: '82359785'