Task: | Book writing |
Sender: | oispa opiskelupaikka tefyllä ;...; |
Submission time: | 2017-05-27 13:10:25 +0300 |
Language: | C++ |
Status: | READY |
Result: | WRONG ANSWER |
test | verdict | time | |
---|---|---|---|
#1 | WRONG ANSWER | 0.04 s | details |
#2 | ACCEPTED | 0.07 s | details |
#3 | ACCEPTED | 0.06 s | details |
#4 | ACCEPTED | 0.04 s | details |
#5 | WRONG ANSWER | 0.04 s | details |
#6 | WRONG ANSWER | 0.06 s | details |
#7 | WRONG ANSWER | 0.05 s | details |
#8 | WRONG ANSWER | 0.03 s | details |
#9 | WRONG ANSWER | 0.03 s | details |
#10 | WRONG ANSWER | 0.04 s | details |
#11 | WRONG ANSWER | 0.07 s | details |
#12 | WRONG ANSWER | 0.04 s | details |
#13 | WRONG ANSWER | 0.04 s | details |
#14 | WRONG ANSWER | 0.04 s | details |
#15 | WRONG ANSWER | 0.06 s | details |
Code
#include <bits/stdc++.h> using namespace std; long long n, m; long long pow(long long b, long long e){ if(e == 0) return 1; else if(e == 1) return b; long long lol = pow(b, e/2); lol = (lol*lol)%m; if(e%2 == 1){ lol*=b; lol%=m; } return lol; } int main(){ cin >> n >> m; cout << pow(3, n-1); return 0; }
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: WRONG ANSWER
input |
---|
1000000000 151663903 |
correct output |
---|
82561644 |
user output |
---|
inf |
Test 6
Verdict: WRONG ANSWER
input |
---|
143596027 174328522 |
correct output |
---|
28118869 |
user output |
---|
inf |
Test 7
Verdict: WRONG ANSWER
input |
---|
147975017 915750433 |
correct output |
---|
463121246 |
user output |
---|
inf |
Test 8
Verdict: WRONG ANSWER
input |
---|
135878271 839118400 |
correct output |
---|
539995449 |
user output |
---|
inf |
Test 9
Verdict: WRONG ANSWER
input |
---|
298512964 952360555 |
correct output |
---|
580557712 |
user output |
---|
inf |
Test 10
Verdict: WRONG ANSWER
input |
---|
529927635 923805382 |
correct output |
---|
726792503 |
user output |
---|
inf |
Test 11
Verdict: WRONG ANSWER
input |
---|
318335201 844538572 |
correct output |
---|
543761245 |
user output |
---|
inf |
Test 12
Verdict: WRONG ANSWER
input |
---|
424831430 113585403 |
correct output |
---|
11977911 |
user output |
---|
inf |
Test 13
Verdict: WRONG ANSWER
input |
---|
365364871 255159067 |
correct output |
---|
164163032 |
user output |
---|
inf |
Test 14
Verdict: WRONG ANSWER
input |
---|
953401405 641246153 |
correct output |
---|
32288812 |
user output |
---|
inf |
Test 15
Verdict: WRONG ANSWER
input |
---|
937783204 624285687 |
correct output |
---|
213518688 |
user output |
---|
inf |