Submission #3017527
Source Code Expand
n=gets.to_i a=Array.new(n) for i in 0 ... n; a[i] = gets.to_i; end pool = Array.new(n) for i in 0 ... n; pool[i] = a[i] ^ (a[i] - 1); end pool.sort! pool.reverse! cnt=0 rem=0 for i in 0...n;rem^=a[i];end for p in pool if (rem^p)<rem rem^=p cnt+=1 end end puts rem==0? cnt:-1
Submission Info
Submission Time | |
---|---|
Task | C - Cheating Nim |
User | kobae964 |
Language | Ruby (2.3.3) |
Score | 500 |
Code Size | 302 Byte |
Status | AC |
Exec Time | 98 ms |
Memory | 4480 KB |
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 500 / 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 | 6 ms | 1788 KB |
001.txt | AC | 7 ms | 1788 KB |
002.txt | AC | 92 ms | 4080 KB |
003.txt | AC | 57 ms | 3228 KB |
004.txt | AC | 48 ms | 2944 KB |
005.txt | AC | 34 ms | 2448 KB |
006.txt | AC | 97 ms | 4352 KB |
007.txt | AC | 98 ms | 4480 KB |
008.txt | AC | 97 ms | 4352 KB |
009.txt | AC | 97 ms | 4352 KB |
010.txt | AC | 98 ms | 4096 KB |
011.txt | AC | 98 ms | 4096 KB |
012.txt | AC | 98 ms | 4352 KB |
013.txt | AC | 98 ms | 4480 KB |
014.txt | AC | 98 ms | 4100 KB |
015.txt | AC | 98 ms | 4096 KB |
016.txt | AC | 98 ms | 4100 KB |
017.txt | AC | 98 ms | 4100 KB |
018.txt | AC | 98 ms | 4092 KB |
019.txt | AC | 98 ms | 4096 KB |
020.txt | AC | 98 ms | 4096 KB |
021.txt | AC | 16 ms | 2296 KB |
022.txt | AC | 16 ms | 2296 KB |
023.txt | AC | 92 ms | 4080 KB |
example0.txt | AC | 7 ms | 1788 KB |
example1.txt | AC | 7 ms | 1788 KB |