CSES - Datatähti 2017 alku - Results
Submission details
Task:Bittijono
Sender:Mbitter
Submission time:2016-10-04 14:26:32 +0300
Language:Python3
Status:READY
Result:0
Feedback
groupverdictscore
#10
#20
#30
Test results
testverdicttimegroup
#10.07 s1details
#20.06 s2details
#30.06 s3details

Code

import re
import math
k = input ()
a = 1
d = 0
b = 0
lis = k.split()
print(lis)
bitti = ["","0","1","1","0","1","0","0","1"]
del lis[0]
def kerroin(a):
    a = 2*a
    return a


while lis:
        k = int(lis[0])
        while k > 4:
            while k > a:
                a = kerroin(a)
            if a > k:
                a = a/2
                #print(a)
                k = k-a
                a = 1
                b = b+1

                #print(str(k) + "HEH")
            if k < 0:
                k = k+a
                k = k-2
                #print(str(k) + "HAH")
            if k == a:
                while a > 4:

                    a = a/2
                    d = d+1

                    if a is 2 or 4:
                        k = a
            if d > 0:
                if d%2 == 0:
                    k = 0
                else:
                    k = 1

        if k < 5:
            if b%2 == 0:
                k = k
            else:
                k = k +4
            print(bitti[int(k)])
            #print(lis[0] +"arvo on " + bitti[int(k)])
            del lis[0]
            a = 1
            d = 0
            b = 0

Test details

Test 1

Group: 1

Verdict:

input
100
62
9
12
73
...

correct output
1
1
1
0
1
...

user output
['100']

Test 2

Group: 2

Verdict:

input
100000
565433
141881
120108
825392
...

correct output
1
1
0
0
1
...

user output
['100000']

Test 3

Group: 3

Verdict:

input
100000
374768524402011755
937067109466254318
389256426086302899
932585725667010169
...

correct output
0
1
1
1
1
...

user output
['100000']