CSES - Datatähti 2017 alku - Results
Submission details
Task:Bittijono
Sender:ankka22
Submission time:2016-10-04 23:22:18 +0300
Language:C++
Status:READY
Result:0
Feedback
groupverdictscore
#10
#20
#30
Test results
testverdicttimegroup
#10.05 s1details
#20.08 s2details
#30.05 s3details

Code

#include <iostream>
#include <bitset>
int main() {
	const int len = 1500;
	//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;
		}
	}
	int v[100000];
	std::cin >> n;
	int cur;
	for (int i = 0; i < n; i++) {
		std::cin >> cur;
		v[i] = bits[(cur % 576) + 1];
	}
	for (int i = 0; i < n; i++) {
		std::cout << v[i];
	}
	//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:

input
100
62
9
12
73
...

correct output
1
1
1
0
1
...

user output
001101000100010110000000101001...

Test 2

Group: 2

Verdict:

input
100000
565433
141881
120108
825392
...

correct output
1
1
0
0
1
...

user output
011001111101111110010001001101...

Test 3

Group: 3

Verdict:

input
100000
374768524402011755
937067109466254318
389256426086302899
932585725667010169
...

correct output
0
1
1
1
1
...

user output
111111111111111111111111111111...