Submission #1000874
Source Code Expand
n = input() A = [int(raw_input()) for i in xrange(n)] rest = 0 bits = [0]*32 rbits = [0]*32 for i in xrange(n): comm = A[i] & (A[i] - 1) rest ^= comm bit = (A[i] - comm).bit_length() bits[bit] ^= 1 for i in xrange(32): if (rest >> i) & 1: rbits[i+1] = 1 ans = 0 for i in xrange(31): if rbits[31-i] and not bits[31-i]: print -1 exit(0) if bits[31-i] and not rbits[31-i]: ans += 1 for j in xrange(i+1, 31): rbits[31-j] ^= 1 bits[31-i] = 0 su = 0 for i in xrange(31): su += (bits[31-i]^rbits[31-i]) print -1 if su else ans
Submission Info
Submission Time | |
---|---|
Task | C - Cheating Nim |
User | yaketake08 |
Language | Python (2.7.6) |
Score | 0 |
Code Size | 639 Byte |
Status | WA |
Exec Time | 243 ms |
Memory | 5892 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 | AC | 17 ms | 2696 KB |
001.txt | AC | 17 ms | 2696 KB |
002.txt | AC | 237 ms | 5892 KB |
003.txt | WA | 147 ms | 4228 KB |
004.txt | AC | 123 ms | 4228 KB |
005.txt | AC | 83 ms | 3588 KB |
006.txt | WA | 242 ms | 5892 KB |
007.txt | WA | 240 ms | 5892 KB |
008.txt | WA | 242 ms | 5892 KB |
009.txt | WA | 238 ms | 5892 KB |
010.txt | WA | 233 ms | 5892 KB |
011.txt | WA | 243 ms | 5892 KB |
012.txt | WA | 233 ms | 5892 KB |
013.txt | WA | 243 ms | 5892 KB |
014.txt | WA | 243 ms | 5892 KB |
015.txt | WA | 243 ms | 5892 KB |
016.txt | AC | 238 ms | 5892 KB |
017.txt | AC | 240 ms | 5892 KB |
018.txt | WA | 238 ms | 5892 KB |
019.txt | WA | 235 ms | 5892 KB |
020.txt | AC | 239 ms | 5892 KB |
021.txt | AC | 36 ms | 2948 KB |
022.txt | AC | 38 ms | 2948 KB |
023.txt | AC | 239 ms | 5892 KB |
example0.txt | AC | 17 ms | 2696 KB |
example1.txt | AC | 17 ms | 2696 KB |