CSES - Putka Open 2020 – 2/5 - Results
Submission details
Task:Summat
Sender:rasastusni
Submission time:2020-09-27 00:25:32 +0300
Language:Python2 (PyPy2)
Status:READY
Result:12
Feedback
groupverdictscore
#1ACCEPTED12
#20
#30
Test results
testverdicttimegroup
#1ACCEPTED0.04 s1, 2, 3details
#2ACCEPTED0.04 s1, 2, 3details
#3ACCEPTED0.05 s1, 2, 3details
#4ACCEPTED0.04 s1, 2, 3details
#5ACCEPTED0.05 s1, 2, 3details
#60.04 s2, 3details
#70.04 s2, 3details
#80.04 s2, 3details
#90.04 s2, 3details
#100.04 s2, 3details
#110.04 s3details
#120.04 s3details
#130.04 s3details
#140.04 s3details
#150.04 s3details

Code

#!/usr/bin/python

from itertools import product, combinations
import sys

juttu1 = [[4, 4, 6, 4, 6, 6], [4, 5, 7, 5, 7, 8], [4, 6, 4, 6, 4, 6], [4, 7, 5, 7, 5, 8], [5, 4, 7, 5, 8, 7], [5, 7, 4, 8, 5, 7], [6, 4, 4, 6, 6, 4], [7, 4, 5, 7, 8, 5], [7, 5, 4, 8, 7, 5], [5, 5, 8, 4, 7, 7], [5, 8, 5, 7, 4, 7], [6, 6, 8, 6, 8, 8], [6, 8, 6, 8, 6, 8], [8, 5, 5, 7, 7, 4], [8, 6, 6, 8, 8, 6], [6, 6, 6, 4, 4, 4], [7, 7, 8, 4, 5, 5], [7, 8, 7, 5, 4, 5], [8, 7, 7, 5, 5, 4], [8, 8, 8, 6, 6, 6]]
juttu2 = [[2, 2, 2, 4], [2, 2, 3, 5], [2, 2, 4, 2], [2, 2, 5, 3], [2, 3, 2, 5], [2, 3, 5, 2], [2, 4, 2, 2], [2, 5, 2, 3], [2, 5, 3, 2], [3, 2, 2, 5], [3, 2, 5, 2], [3, 3, 3, 5], [3, 3, 5, 3], [3, 5, 2, 2], [3, 5, 3, 3], [4, 2, 2, 2], [5, 2, 2, 3], [5, 2, 3, 2], [5, 3, 2, 2], [5, 3, 3, 3]]

n = int(raw_input())
paska = [int(x) for x in raw_input().split(" ")]
lista = sorted(paska)

if n < 3 or n > 5:
	raise Exception('asdf')

for x in product([1,2,3,4,5], repeat=n):
	candidate = [a+b for a,b in combinations(x, 2)]
	if sorted(candidate) == lista:
		for asd, sad in enumerate(juttu1):
			if sad == paska:
				x = juttu2[asd]
		print ' '.join([str(y) for y in x])
		sys.exit()
print 'asdfadsfasdf'
raise Exception('asdfasdf')

Test details

Test 1

Group: 1, 2, 3

Verdict: ACCEPTED

input
5
2 2 2 2 2 2 2 2 2 2

correct output
1 1 1 1 1 

user output
1 1 1 1 1

Test 2

Group: 1, 2, 3

Verdict: ACCEPTED

input
5
3 4 5 5 6 6 7 7 8 9

correct output
1 2 3 4 5 

user output
1 2 3 4 5

Test 3

Group: 1, 2, 3

Verdict: ACCEPTED

input
5
5 6 6 6 9 9 9 10 10 10

correct output
1 4 5 5 5 

user output
1 4 5 5 5

Test 4

Group: 1, 2, 3

Verdict: ACCEPTED

input
5
2 3 3 6 6 6 6 7 7 10

correct output
1 1 2 5 5 

user output
1 1 2 5 5

Test 5

Group: 1, 2, 3

Verdict: ACCEPTED

input
5
4 5 5 5 5 6 6 6 7 7

correct output
2 2 3 3 4 

user output
2 2 3 3 4

Test 6

Group: 2, 3

Verdict:

input
20
2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 ...

correct output
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 14, in <module>
    raise...

Test 7

Group: 2, 3

Verdict:

input
20
3 4 5 5 6 6 7 7 7 8 8 8 9 9 9 ...

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

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 14, in <module>
    raise...

Test 8

Group: 2, 3

Verdict:

input
20
52 55 55 57 62 62 63 64 66 71 ...

correct output
1 51 54 54 56 61 61 62 63 65 7...

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 14, in <module>
    raise...

Test 9

Group: 2, 3

Verdict:

input
20
25 30 31 32 36 39 40 41 45 45 ...

correct output
8 17 22 23 24 28 43 50 53 55 6...

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 14, in <module>
    raise...

Test 10

Group: 2, 3

Verdict:

input
20
9 10 14 17 17 20 21 22 24 25 2...

correct output
1 8 9 13 16 19 30 32 38 40 43 ...

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 14, in <module>
    raise...

Test 11

Group: 3

Verdict:

input
100
2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 ...

correct output
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 14, in <module>
    raise...

Test 12

Group: 3

Verdict:

input
100
3 4 5 5 6 6 7 7 7 8 8 8 9 9 9 ...

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

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 14, in <module>
    raise...

Test 13

Group: 3

Verdict:

input
100
502824619 505239810 505668108 ...

correct output
1 502824618 505239809 50566810...

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 14, in <module>
    raise...

Test 14

Group: 3

Verdict:

input
100
17871832 41618648 51611938 538...

correct output
3939271 13932561 37679377 4989...

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 14, in <module>
    raise...

Test 15

Group: 3

Verdict:

input
100
70588435 115481965 116040218 1...

correct output
5902586 64685849 109579379 110...

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 14, in <module>
    raise...