CSES - Datatähti 2017 alku - Results
Submission details
Task:Järjestys
Sender:inkeri
Submission time:2016-10-08 00:04:10 +0300
Language:Python2
Status:READY
Result:0
Feedback
groupverdictscore
#10
#20
#30
Test results
testverdicttimegroup
#10.06 s1details
#20.06 s2details
#30.06 s3details

Code

def main():
    import math
    amount = int(input(""))
    bitit = [0, 1]

    for i in xrange(amount):
        luku = int(input(""))

        while (luku > 2):
            length = int(math.pow(2, math.ceil(math.log(luku, 2))))
            luku -= length/4
            if (luku > length/2):
                luku -= length/2

        print bitit[luku - 1]

main()

Test details

Test 1

Group: 1

Verdict:

input
10
9 3 4 7 6 5 10 2 8 1

correct output
32
10 10 9 10 9 8 7 9 4 2 1 4 5 2...

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 17, in <module>
    main()
  File "input/code.py", line 7, in main
    luku = int(input(""))
  File "<string>", line 1
    9 3 4 7 6 5 10 2 8 1
      ^
SyntaxError: invalid syntax

Test 2

Group: 2

Verdict:

input
1000
650 716 982 41 133 1000 876 92...

correct output
3984
207 207 206 207 128 127 126 12...

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 17, in <module>
    main()
  File "input/code.py", line 7, in main
    luku = int(input(""))
  File "<string>", line 1
    650 716 982 41 133 1000 876 92 995 642 309 178 815 579 326 222 339 181 657 641 166 5 329 625 136 295 795 24 860 389 891 245 736 335 37 495 717 640 494 459 164 609 836 635 431 856 606 455 483 963 444 410 728 63 590 31 734 416 828 72 613 370 193 807 801 747 839 618 584 238 855 684 838 840 296 287 993 380 375 487 912 484 175 781 682 492 607 423 359 859 800 992 176 653 344 517 999 799 208 757 206 805 348 565 209 772 111 467 927 249 276 595 983 683 816 914 634 931 603 824 776 38 932 160 397 367 2 127 784 83 377 998 556 50 572 627 846 500 10 279 567 873 677 767 974 271 95 140 645 79 224 532 117 907 100 352 893 57 996 697 266 779 324 110 569 976 414 899 374 793 379 537 49 246 382 498 605 729 887 261 132 930 589 823 534 350 615 806 711 307 676 474 211 543 901 632 462 336 854 430 809 201 312 792 337 475 1 155 1...

Test 3

Group: 3

Verdict:

input
100000
94703 47808 62366 31885 7091 8...

correct output
399956
98676 98676 98675 98676 62994 ...

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 17, in <module>
    main()
  File "input/code.py", line 7, in main
    luku = int(input(""))
  File "<string>", line 1
    94703 47808 62366 31885 7091 81189 71177 44619 91108 50645 46802 40677 80065 78125 57533 47579 64961 54157 37216 9985 73684 83819 21257 66916 13543 30933 79090 92999 54956 67342 11903 4320 10514 47195 48177 17685 94617 43817 72907 9115 15993 54840 95761 14779 58642 96105 28713 95166 28217 85283 83976 97626 64056 44361 68380 25330 66179 84163 90601 11271 74444 54836 45535 92792 24499 97639 21308 96696 22990 19384 31756 29484 85234 40517 98606 52807 11037 82089 19386 59126 5697 7280 65873 41926 15949 84269 35058 3250 23304 33541 33454 78674 38690 67092 83612 95569 87285 70581 81052 46282 86449 16172 22751 44494 55509 88230 35820 91107 21452 47988 88652 16279 15786 97193 91159 6798 53727 50277 47773 29327 13081 56787 46988 89386 93056 14947 60244 15289 79101 37309 87855 99808 74086 53373 25348 59606 70517...