CSES - KILO 2019 3/5 - Results
Submission details
Task:Taulukot
Sender:haapseem
Submission time:2019-05-28 20:01:44 +0300
Language:Python3
Status:READY
Result:0
Feedback
groupverdictscore
#10
#20
#30
Test results
testverdicttimegroup
#10.04 s1details
#20.05 s1details
#30.05 s1details
#40.05 s1details
#50.04 s1details
#60.05 s2details
#70.07 s2details
#80.05 s2details
#90.06 s2details
#100.06 s2details
#11--3details
#12--3details
#13--3details
#14--3details
#15--3details

Code

def is_prime(n):
    a = []
    while n > 2:
        a.append(2**(n-1)%n)
        n //= 2
        n = int(n)
    return sum(a)-1 == len(a)

def gen_line(n):
    a = [m for m in range(n+1, 1, -1)]
    return a,a

n = int(input())

a,b = gen_line(n)
c = []

for i in range(len(a)):
    for j in range(len(b)):
        if b[j] in c:
            continue
        if is_prime(a[i] + b[j]):
            c.append(b[j])
            #continue
            break

print(a)
print(c)

Test details

Test 1

Group: 1

Verdict:

input
1

correct output


user output
[2]
[]

Test 2

Group: 1

Verdict:

input
4

correct output
1 2 3 4 
2 1 4 3 

user output
[5, 4, 3, 2]
[5, 2, 3, 4]

Test 3

Group: 1

Verdict:

input
5

correct output
1 2 3 4 5 
1 5 4 3 2 

user output
[6, 5, 4, 3, 2]
[4, 5, 6, 3]

Test 4

Group: 1

Verdict:

input
8

correct output
1 2 3 4 5 6 7 8 
2 1 4 3 8 7 6 5 

user output
[9, 8, 7, 6, 5, 4, 3, 2]
[5, 6, 7, 8, 9, 2, 3, 4]

Test 5

Group: 1

Verdict:

input
9

correct output
1 2 3 4 5 6 7 8 9 
1 5 4 3 2 7 6 9 8 

user output
[10, 9, 8, 7, 6, 5, 4, 3, 2]
[4, 5, 6, 7, 8, 9, 10, 3]

Test 6

Group: 2

Verdict:

input
77

correct output
1 2 3 4 5 6 7 8 9 10 11 12 13 ...

user output
[78, 77, 76, 75, 74, 73, 72, 7...

Test 7

Group: 2

Verdict:

input
70

correct output
1 2 3 4 5 6 7 8 9 10 11 12 13 ...

user output
[71, 70, 69, 68, 67, 66, 65, 6...

Test 8

Group: 2

Verdict:

input
72

correct output
1 2 3 4 5 6 7 8 9 10 11 12 13 ...

user output
[73, 72, 71, 70, 69, 68, 67, 6...

Test 9

Group: 2

Verdict:

input
86

correct output
1 2 3 4 5 6 7 8 9 10 11 12 13 ...

user output
[87, 86, 85, 84, 83, 82, 81, 8...

Test 10

Group: 2

Verdict:

input
68

correct output
1 2 3 4 5 6 7 8 9 10 11 12 13 ...

user output
[69, 68, 67, 66, 65, 64, 63, 6...

Test 11

Group: 3

Verdict:

input
90764

correct output
1 2 3 4 5 6 7 8 9 10 11 12 13 ...

user output
(empty)

Test 12

Group: 3

Verdict:

input
97976

correct output
1 2 3 4 5 6 7 8 9 10 11 12 13 ...

user output
(empty)

Test 13

Group: 3

Verdict:

input
96762

correct output
1 2 3 4 5 6 7 8 9 10 11 12 13 ...

user output
(empty)

Test 14

Group: 3

Verdict:

input
94823

correct output
1 2 3 4 5 6 7 8 9 10 11 12 13 ...

user output
(empty)

Test 15

Group: 3

Verdict:

input
91479

correct output
1 2 3 4 5 6 7 8 9 10 11 12 13 ...

user output
(empty)