Task: | Bittijono |
Sender: | Diapolo10 |
Submission time: | 2016-10-05 13:05:41 +0300 |
Language: | Python3 |
Status: | READY |
Result: | 0 |
group | verdict | score |
---|---|---|
#1 | WRONG ANSWER | 0 |
#2 | TIME LIMIT EXCEEDED | 0 |
#3 | RUNTIME ERROR | 0 |
test | verdict | time | group | |
---|---|---|---|---|
#1 | WRONG ANSWER | 0.06 s | 1 | details |
#2 | TIME LIMIT EXCEEDED | -- | 2 | details |
#3 | RUNTIME ERROR | 1.67 s | 3 | details |
Code
#! python3 # CSES 2017: Tehtävä 2 import math def gen(num): ## limit = num%2^x ## kysytään 4. arvoa (eli lista[7+1]) ## 4==2^2 ## 4%2^2==0 ## x. juuri 4 % 2 == 0 ## 4^(1/x) % 2 == 0 a = num b = [0,1,1,0,1,0,0,1] #b = math.log(a, 10) while a>len(b): b += swapper(b)+b print(b[a-1]) def swapper(lst): """Take a list and swap 0 to 1 and 1 to 0""" switch = {0:1, 1:0} return [switch[i] for i in lst] def main(): #TODO: Try generating list on the fly by input%pow nums = [0] for i in range(10): nums+=swapper(nums) for i in range(int(input())): feed = int(input()) gen(feed) if __name__ == "__main__": main()
Test details
Test 1
Group: 1
Verdict: WRONG ANSWER
input |
---|
100 62 9 12 73 ... |
correct output |
---|
1 1 1 0 1 ... |
user output |
---|
1 1 1 1 1 ... |
Test 2
Group: 2
Verdict: TIME LIMIT EXCEEDED
input |
---|
100000 565433 141881 120108 825392 ... |
correct output |
---|
1 1 0 0 1 ... |
user output |
---|
(empty) |
Test 3
Group: 3
Verdict: RUNTIME ERROR
input |
---|
100000 374768524402011755 937067109466254318 389256426086302899 932585725667010169 ... |
correct output |
---|
0 1 1 1 1 ... |
user output |
---|
(empty) |