CSES - Datatähti 2017 alku - Results
Submission details
Task:Bittijono
Sender:gokuha
Submission time:2016-10-11 18:39:07 +0300
Language:C++
Status:COMPILE ERROR

Compiler report

input/code.cpp: In function 'int main()':
input/code.cpp:8:1: error: 'longlong' was not declared in this scope
 longlong e;
 ^
input/code.cpp:8:10: error: expected ';' before 'e'
 longlong e;
          ^
input/code.cpp:12:1: error: 'e' was not declared in this scope
 e=1<<60;
 ^
input/code.cpp:12:6: warning: left shift count >= width of type [enabled by default]
 e=1<<60;
      ^
input/code.cpp:13:9: error: expected primary-expression before ')' token
 while(c)) {
         ^
input/code.cpp:13:9: error: expected ';' before ')' token
input/code.cpp:21:11: error: expected '}' at end of input
 cout>>0;}}}
           ^
input/code.cpp:21:11: error: expected '}' at end of input

Code

#include <iostream>
using namespace std;
int main(){
int a;
cin>>a;
for (int b=0; b<a;b+=1){
int c,d;
longlong e;
cin>>c;
c-=1;
d=0;
e=1<<60;
while(c)) {
if e<c+1{
c-=e;
d+=1;}
e>>=1;}
if d%2==1{
cout<<1;}
else{
cout>>0;}}}