CSES - Datatähti 2017 alku - Results
Submission details
Task:Bittijono
Sender:tuomask
Submission time:2016-10-06 20:06:49 +0300
Language:C++
Status:READY
Result:0
Feedback
groupverdictscore
#10
#20
#30
Test results
testverdicttimegroup
#10.06 s1details
#20.12 s2details
#30.06 s3details

Compiler report

input/code.cpp: In function 'int main()':
input/code.cpp:11:30: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for (unsigned int i=0; i<input_length; i++) {
                              ^

Code

#include <iostream>
#include <sstream>

using namespace std;

int main() {
	int input_length;
    
    cin >> input_length;
    
    for (unsigned int i=0; i<input_length; i++) {
    	int index;
    	cin >> index;
    	
    	int times = 0;
    	int curr_index = index;
    	while (curr_index > 3) {
    		if (curr_index % 2 == 0) {
    			curr_index = curr_index / 2;
    		} else {
    			curr_index = (curr_index-1) / 2;
    		}
    		times++;
    	}
    	
    	cout << times % 2 << '\n';
    }
    
    cout << endl;
    
    /*
    unsigned int kerroin = 0;
	string kerrattava = "";
	
	std::ostringstream os;
		
	for (unsigned int i=0; i<input.length(); i++) {
			
		if (input[i] >= '0' && input[i] <= '9') {
				
			if (kerrattava != "") {
				while (kerroin > 0) {
					os << kerrattava;
					kerroin--;
				}
				kerrattava = "";
				kerroin = input[i]-'0';
			} else {
				kerroin = kerroin*10 + (input[i]-'0');
			}
		} else {
			kerrattava += input[i];
		}
	}
		
	while (kerroin > 0) {
		os << kerrattava;
		kerroin--;
	}
    
    cout << os.str() << endl;*/
}

Test details

Test 1

Group: 1

Verdict:

input
100
62
9
12
73
...

correct output
1
1
1
0
1
...

user output
0
0
0
1
0
...

Test 2

Group: 2

Verdict:

input
100000
565433
141881
120108
825392
...

correct output
1
1
0
0
1
...

user output
0
0
1
0
0
...

Test 3

Group: 3

Verdict:

input
100000
374768524402011755
937067109466254318
389256426086302899
932585725667010169
...

correct output
0
1
1
1
1
...

user output
1
1
1
1
1
...