Submission #1833578
Source Code Expand
#include "iostream" #include "climits" #include "list" #include "queue" #include "stack" #include "set" #include "functional" #include "algorithm" #include "string" #include "map" #include "iomanip" #include "cmath" using namespace std; const long long int MOD = 1000000007; long long int N, M, K, H, W, L, R; int main() { ios::sync_with_stdio(false); cin.tie(0); cin >> N; vector<long long int>v(N); for (int i = 0; i < N; i++) { cin >> v[i]; M ^= v[i]; } for (int i = 31; i >=0; i--) { if (M >> i & 1) { bool flag = false; for (int j = 0; j < N; j++) { if (v[j] % (int)pow(2, i) == 0) { flag = true; } } if (!flag) { cout << "-1\n"; return 0; } M ^= (int)(pow(2, i) - 1); K++; } } cout << K << endl; return 0; }
Submission Info
Submission Time | |
---|---|
Task | C - Cheating Nim |
User | olphe |
Language | C++14 (GCC 5.4.1) |
Score | 0 |
Code Size | 825 Byte |
Status | WA |
Exec Time | 153 ms |
Memory | 1024 KB |
Judge Result
Set Name | Sample | All | ||||||
---|---|---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 0 / 500 | ||||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | example0.txt, example1.txt |
All | 000.txt, 001.txt, 002.txt, 003.txt, 004.txt, 005.txt, 006.txt, 007.txt, 008.txt, 009.txt, 010.txt, 011.txt, 012.txt, 013.txt, 014.txt, 015.txt, 016.txt, 017.txt, 018.txt, 019.txt, 020.txt, 021.txt, 022.txt, 023.txt, example0.txt, example1.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
000.txt | WA | 1 ms | 256 KB |
001.txt | AC | 1 ms | 256 KB |
002.txt | AC | 12 ms | 1024 KB |
003.txt | AC | 24 ms | 768 KB |
004.txt | AC | 9 ms | 640 KB |
005.txt | AC | 7 ms | 512 KB |
006.txt | AC | 138 ms | 1024 KB |
007.txt | AC | 122 ms | 1024 KB |
008.txt | AC | 144 ms | 1024 KB |
009.txt | AC | 153 ms | 1024 KB |
010.txt | AC | 94 ms | 1024 KB |
011.txt | AC | 92 ms | 1024 KB |
012.txt | AC | 100 ms | 1024 KB |
013.txt | AC | 106 ms | 1024 KB |
014.txt | AC | 108 ms | 1024 KB |
015.txt | AC | 108 ms | 1024 KB |
016.txt | WA | 122 ms | 1024 KB |
017.txt | WA | 106 ms | 1024 KB |
018.txt | AC | 124 ms | 1024 KB |
019.txt | AC | 102 ms | 1024 KB |
020.txt | WA | 126 ms | 1024 KB |
021.txt | AC | 3 ms | 384 KB |
022.txt | WA | 12 ms | 384 KB |
023.txt | AC | 19 ms | 1024 KB |
example0.txt | AC | 1 ms | 256 KB |
example1.txt | AC | 1 ms | 256 KB |