Task: | Bittijono |
Sender: | ankka22 |
Submission time: | 2016-10-04 23:39:52 +0300 |
Language: | C++ |
Status: | READY |
Result: | 10 |
group | verdict | score |
---|---|---|
#1 | ACCEPTED | 10 |
#2 | WRONG ANSWER | 0 |
#3 | WRONG ANSWER | 0 |
test | verdict | time | group | |
---|---|---|---|---|
#1 | ACCEPTED | 0.05 s | 1 | details |
#2 | WRONG ANSWER | 0.15 s | 2 | details |
#3 | WRONG ANSWER | 0.17 s | 3 | details |
Code
#include <iostream> #include <bitset> int main() { const int len = 15000; //std::cout << "heiisdfi" << std::endl; bool bits[len] = {0}; bits[0] = 0; bits[1] = 1; int currentLength = 4; int n = 2; while (1) { bits[n] = !bits[n - currentLength / 2]; n++; if (currentLength == n) { currentLength *= 2; } if (currentLength > len) { break; } } long long int v[100000]; std::cin >> n; long long int cur; for (int i = 0; i < n; i++) { std::cin >> cur; v[i] = bits[(cur - 1) % 1024]; } for (int i = 0; i < n; i++) { std::cout << v[i] << std::endl; } //576 /*int thisRow = 0; int perRow = 8; bool newRow = true; int row = 1; int thisBlock = 24; int perBlock = 25; for (int i = 0; i < len; i++) { if (newRow) { std::cout << row << " "; newRow = false; } std::cout << bits[i]; if ((i+1) % 4 == 0) { std::cout << " "; thisRow++; if (thisRow == perRow) { std::cout << std::endl; thisRow = 0; row++; newRow = true; } } } std::cout << "599" << bits[600]; std::cout << std::endl;*/ return 0; } //01101001100101101001011001101001100101100110100101101001100101101001011001 //01101001100101101001011001101001 /* Syöte: 3 5 2 7 Tuloste: 1 1 0 */
Test details
Test 1
Group: 1
Verdict: ACCEPTED
input |
---|
100 62 9 12 73 ... |
correct output |
---|
1 1 1 0 1 ... |
user output |
---|
1 1 1 0 1 ... |
Test 2
Group: 2
Verdict: WRONG ANSWER
input |
---|
100000 565433 141881 120108 825392 ... |
correct output |
---|
1 1 0 0 1 ... |
user output |
---|
0 0 1 1 1 ... |
Test 3
Group: 3
Verdict: WRONG ANSWER
input |
---|
100000 374768524402011755 937067109466254318 389256426086302899 932585725667010169 ... |
correct output |
---|
0 1 1 1 1 ... |
user output |
---|
1 0 0 1 0 ... |