Task: | Book writing |
Sender: | IOG |
Submission time: | 2017-05-27 15:02:14 +0300 |
Language: | C++ |
Status: | READY |
Result: | WRONG ANSWER |
test | verdict | time | |
---|---|---|---|
#1 | WRONG ANSWER | 0.07 s | details |
#2 | ACCEPTED | 0.06 s | details |
#3 | ACCEPTED | 0.05 s | details |
#4 | ACCEPTED | 0.05 s | details |
#5 | TIME LIMIT EXCEEDED | -- | details |
#6 | TIME LIMIT EXCEEDED | -- | details |
#7 | TIME LIMIT EXCEEDED | -- | details |
#8 | TIME LIMIT EXCEEDED | -- | details |
#9 | TIME LIMIT EXCEEDED | -- | details |
#10 | TIME LIMIT EXCEEDED | -- | details |
#11 | TIME LIMIT EXCEEDED | -- | details |
#12 | TIME LIMIT EXCEEDED | -- | details |
#13 | TIME LIMIT EXCEEDED | -- | details |
#14 | TIME LIMIT EXCEEDED | -- | details |
#15 | TIME LIMIT EXCEEDED | -- | details |
Code
#include <bits/stdc++.h> using namespace std; int main(void) { cin.sync_with_stdio(0); cin.tie(0); long long mod, p; cin >> p >> mod; long long res = 1; for (int i = 0; i < p-1; i++) { res = (res*3)%mod; } cout << res << endl; }
Test details
Test 1
Verdict: WRONG ANSWER
input |
---|
1 1 |
correct output |
---|
0 |
user output |
---|
1 |
Test 2
Verdict: ACCEPTED
input |
---|
1 97 |
correct output |
---|
1 |
user output |
---|
1 |
Test 3
Verdict: ACCEPTED
input |
---|
2 97 |
correct output |
---|
3 |
user output |
---|
3 |
Test 4
Verdict: ACCEPTED
input |
---|
3 97 |
correct output |
---|
9 |
user output |
---|
9 |
Test 5
Verdict: TIME LIMIT EXCEEDED
input |
---|
1000000000 151663903 |
correct output |
---|
82561644 |
user output |
---|
(empty) |
Test 6
Verdict: TIME LIMIT EXCEEDED
input |
---|
143596027 174328522 |
correct output |
---|
28118869 |
user output |
---|
(empty) |
Test 7
Verdict: TIME LIMIT EXCEEDED
input |
---|
147975017 915750433 |
correct output |
---|
463121246 |
user output |
---|
(empty) |
Test 8
Verdict: TIME LIMIT EXCEEDED
input |
---|
135878271 839118400 |
correct output |
---|
539995449 |
user output |
---|
(empty) |
Test 9
Verdict: TIME LIMIT EXCEEDED
input |
---|
298512964 952360555 |
correct output |
---|
580557712 |
user output |
---|
(empty) |
Test 10
Verdict: TIME LIMIT EXCEEDED
input |
---|
529927635 923805382 |
correct output |
---|
726792503 |
user output |
---|
(empty) |
Test 11
Verdict: TIME LIMIT EXCEEDED
input |
---|
318335201 844538572 |
correct output |
---|
543761245 |
user output |
---|
(empty) |
Test 12
Verdict: TIME LIMIT EXCEEDED
input |
---|
424831430 113585403 |
correct output |
---|
11977911 |
user output |
---|
(empty) |
Test 13
Verdict: TIME LIMIT EXCEEDED
input |
---|
365364871 255159067 |
correct output |
---|
164163032 |
user output |
---|
(empty) |
Test 14
Verdict: TIME LIMIT EXCEEDED
input |
---|
953401405 641246153 |
correct output |
---|
32288812 |
user output |
---|
(empty) |
Test 15
Verdict: TIME LIMIT EXCEEDED
input |
---|
937783204 624285687 |
correct output |
---|
213518688 |
user output |
---|
(empty) |