| Task: | Grid |
| Sender: | Ace of Spades |
| Submission time: | 2017-05-27 11:29:26 +0300 |
| Language: | C++ |
| Status: | READY |
| Result: | WRONG ANSWER |
| test | verdict | time | |
|---|---|---|---|
| #1 | WRONG ANSWER | 0.04 s | details |
| #2 | WRONG ANSWER | 0.05 s | details |
| #3 | WRONG ANSWER | 0.05 s | details |
| #4 | WRONG ANSWER | 0.04 s | details |
| #5 | WRONG ANSWER | 0.04 s | details |
| #6 | WRONG ANSWER | 0.06 s | details |
| #7 | WRONG ANSWER | 0.04 s | details |
| #8 | WRONG ANSWER | 0.05 s | details |
| #9 | WRONG ANSWER | 0.06 s | details |
| #10 | WRONG ANSWER | 0.05 s | details |
| #11 | WRONG ANSWER | 0.06 s | details |
| #12 | WRONG ANSWER | 0.04 s | details |
| #13 | WRONG ANSWER | 0.06 s | details |
| #14 | WRONG ANSWER | 0.04 s | details |
| #15 | WRONG ANSWER | 0.04 s | details |
| #16 | WRONG ANSWER | 0.07 s | details |
| #17 | WRONG ANSWER | 0.06 s | details |
| #18 | WRONG ANSWER | 0.04 s | details |
| #19 | WRONG ANSWER | 0.05 s | details |
| #20 | WRONG ANSWER | 0.05 s | details |
| #21 | WRONG ANSWER | 0.05 s | details |
| #22 | WRONG ANSWER | 0.04 s | details |
| #23 | WRONG ANSWER | 0.05 s | details |
| #24 | WRONG ANSWER | 0.04 s | details |
| #25 | WRONG ANSWER | 0.04 s | details |
| #26 | WRONG ANSWER | 0.04 s | details |
| #27 | WRONG ANSWER | 0.03 s | details |
Code
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
ll n,m;
cin>>n>>m;
ll ans = 1;
--n;
ll q = 3;
for(;n; n/=2) {
if(n&1) {
ans = ans*q%m;
}
q = q*q%m;
}
cout<<ans<<'\n';
}
Test details
Test 1
Verdict: WRONG ANSWER
| input |
|---|
| 10 20 11111111111111111111 11111111111111111111 11111111111111111111 11111111111111111111 ... |
| correct output |
|---|
| 8379 |
| user output |
|---|
| 3 |
Test 2
Verdict: WRONG ANSWER
| input |
|---|
| 20 10 1111111111 1101111111 1111111111 1111111111 ... |
| correct output |
|---|
| 7880 |
| user output |
|---|
| 7 |
Test 3
Verdict: WRONG ANSWER
| input |
|---|
| 10 20 11111111010111111101 11111110011011111111 11111100011111111111 11101111111111111111 ... |
| correct output |
|---|
| 5106 |
| user output |
|---|
| 3 |
Test 4
Verdict: WRONG ANSWER
| input |
|---|
| 20 10 1111100111 1111111111 1011111110 1111111111 ... |
| correct output |
|---|
| 4563 |
| user output |
|---|
| 7 |
Test 5
Verdict: WRONG ANSWER
| input |
|---|
| 10 20 11011011011111111110 11111010110110110001 11010010111101111010 01111111111110101111 ... |
| correct output |
|---|
| 3099 |
| user output |
|---|
| 3 |
Test 6
Verdict: WRONG ANSWER
| input |
|---|
| 20 10 1110111111 1111111111 1101101110 0111110011 ... |
| correct output |
|---|
| 2973 |
| user output |
|---|
| 7 |
Test 7
Verdict: WRONG ANSWER
| input |
|---|
| 10 20 01101101111101110101 10011111111111110111 01111101011010110011 10110101110110101011 ... |
| correct output |
|---|
| 2581 |
| user output |
|---|
| 3 |
Test 8
Verdict: WRONG ANSWER
| input |
|---|
| 20 10 1110111001 0111001001 1111011011 1111111010 ... |
| correct output |
|---|
| 1660 |
| user output |
|---|
| 7 |
Test 9
Verdict: WRONG ANSWER
| input |
|---|
| 10 20 11000000001100011111 11100111101100110110 11001110011110110101 10100001111011001111 ... |
| correct output |
|---|
| 1015 |
| user output |
|---|
| 3 |
Test 10
Verdict: WRONG ANSWER
| input |
|---|
| 20 10 1000011001 1101111110 1000111111 1101101010 ... |
| correct output |
|---|
| 1135 |
| user output |
|---|
| 7 |
Test 11
Verdict: WRONG ANSWER
| input |
|---|
| 10 20 10000101101101000110 00100010110011011011 11110111110101101011 11101100011101001011 ... |
| correct output |
|---|
| 708 |
| user output |
|---|
| 3 |
Test 12
Verdict: WRONG ANSWER
| input |
|---|
| 20 10 1000011111 0001001100 0101110110 1111110001 ... |
| correct output |
|---|
| 394 |
| user output |
|---|
| 7 |
Test 13
Verdict: WRONG ANSWER
| input |
|---|
| 10 20 00010111101111010011 11010001011010010110 10011001011010100011 01100011001000001100 ... |
| correct output |
|---|
| 294 |
| user output |
|---|
| 3 |
Test 14
Verdict: WRONG ANSWER
| input |
|---|
| 20 10 0011001110 0000001111 1011100000 0000001001 ... |
| correct output |
|---|
| 166 |
| user output |
|---|
| 7 |
Test 15
Verdict: WRONG ANSWER
| input |
|---|
| 10 20 10011010001011000110 00100000100000000000 00000110001000110001 01000000101100110101 ... |
| correct output |
|---|
| 87 |
| user output |
|---|
| 3 |
Test 16
Verdict: WRONG ANSWER
| input |
|---|
| 20 10 0000110101 1000000001 0101100110 0100001010 ... |
| correct output |
|---|
| 134 |
| user output |
|---|
| 7 |
Test 17
Verdict: WRONG ANSWER
| input |
|---|
| 10 20 00000001100001000100 00000100000010000001 00000100000010000010 10000010000000100000 ... |
| correct output |
|---|
| 5 |
| user output |
|---|
| 3 |
Test 18
Verdict: WRONG ANSWER
| input |
|---|
| 20 10 0100001000 0100000000 0000010001 0000101000 ... |
| correct output |
|---|
| 4 |
| user output |
|---|
| 7 |
Test 19
Verdict: WRONG ANSWER
| input |
|---|
| 10 20 00100010000100000000 00000000000000000000 00100000000000000000 00000001000000000010 ... |
| correct output |
|---|
| 0 |
| user output |
|---|
| 3 |
Test 20
Verdict: WRONG ANSWER
| input |
|---|
| 20 10 0000010000 0000000000 1000000000 0000000000 ... |
| correct output |
|---|
| 0 |
| user output |
|---|
| 7 |
Test 21
Verdict: WRONG ANSWER
| input |
|---|
| 10 20 00000000000000000000 00000000000000000000 00000000000000000000 00000000000000000000 ... |
| correct output |
|---|
| 0 |
| user output |
|---|
| 3 |
Test 22
Verdict: WRONG ANSWER
| input |
|---|
| 20 10 0000000000 0000000000 0000000000 0000000000 ... |
| correct output |
|---|
| 0 |
| user output |
|---|
| 7 |
Test 23
Verdict: WRONG ANSWER
| input |
|---|
| 3000 3000 111111111111111111111111111111... |
| correct output |
|---|
| 19444691141193 |
| user output |
|---|
| 2667 |
Test 24
Verdict: WRONG ANSWER
| input |
|---|
| 3000 3000 001011111110111101100001111011... |
| correct output |
|---|
| 6150476374242 |
| user output |
|---|
| 2667 |
Test 25
Verdict: WRONG ANSWER
| input |
|---|
| 3000 3000 001011000111011110110111111110... |
| correct output |
|---|
| 1213493895016 |
| user output |
|---|
| 2667 |
Test 26
Verdict: WRONG ANSWER
| input |
|---|
| 3000 3000 000000001001000010110001000001... |
| correct output |
|---|
| 75998707871 |
| user output |
|---|
| 2667 |
Test 27
Verdict: WRONG ANSWER
| input |
|---|
| 3000 3000 000000000000000000000000000000... |
| correct output |
|---|
| 0 |
| user output |
|---|
| 2667 |
