CSES - Datatähti 2018 loppu - Results
Submission details
Task:Vaihdot
Sender:Uolevi
Submission time:2018-01-18 17:14:28 +0200
Language:Python3
Status:READY
Result:0
Feedback
groupverdictscore
#10
#20
#30
Test results
testverdicttimegroup
#10.08 s1details
#20.06 s1details
#30.06 s1details
#40.07 s1details
#5ACCEPTED0.07 s1details
#60.06 s2details
#70.07 s2details
#80.06 s2details
#90.08 s2details
#10ACCEPTED0.07 s2details
#110.25 s3details
#120.26 s3details
#130.25 s3details
#140.25 s3details
#15ACCEPTED0.25 s3details

Code

n  = int(input())
m = {}
s = {}
array = []
for i in range(n):
	x = [int(i) for i in input().split()]
	m[i] = x

for i in range(n):
	x = [int(i) for i in input().split()]
	s[i] = x


	
if m[0]!=s[0]:
	if m[0][0] == s[0][0]:
		array.append("2 2 3")
		m[0][1],m[0][2] = m[0][2],m[0][1]
	elif m[0][0] == s[0][1]:
		array.append("2 1 2")
		m[0][0],m[0][1] = m[0][1],m[0][0]
	elif m[0][0] == s[0][2]:
		array.append("2 1 3")
		m[0][0],m[0][2] = m[0][2],m[0][0]	
	else:
		print(-1)

	if m[0] == s[0]:
		array.append("1 2 3")
		m[1],m[2] = m[2],m[1]
	elif m[0] == s[2]:
		m[0],m[1]=m[1],m[0]
		array.append("1 1 2")
	elif m[0] == s[2]:
		m[0],m[2] = m[2],m[0]
		array.append("1 1 3")
	else:
		print(-1)

	print(m)
#print(len(array))
for i in array:
	print(i)

Test details

Test 1

Group: 1

Verdict:

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

correct output
2
2 1 3
2 1 2

user output
-1
{0: [7, 1, 2], 1: [4, 3, 6], 2...

Test 2

Group: 1

Verdict:

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

correct output
2
1 2 3
2 1 2

user output
{0: [7, 3, 2], 1: [4, 8, 9], 2...

Test 3

Group: 1

Verdict:

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

correct output
1
2 2 3

user output
{0: [3, 8, 7], 1: [6, 9, 2], 2...

Test 4

Group: 1

Verdict:

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

correct output
0

user output
(empty)

Test 5

Group: 1

Verdict: ACCEPTED

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

correct output
-1

user output
-1
-1
{0: [6, 5, 8], 1: [1, 2, 4], 2...

Test 6

Group: 2

Verdict:

input
50
2080 2133 335 2071 1666 1889 4...

correct output
89
1 1 27
1 1 47
1 1 32
1 1 2
...

user output
-1
-1
{0: [2080, 2133, 335, 2071, 16...

Test 7

Group: 2

Verdict:

input
50
59 2140 2044 1095 520 1562 153...

correct output
88
1 1 29
1 1 47
1 1 3
1 1 26
...

user output
-1
-1
{0: [59, 2140, 2044, 1095, 520...

Test 8

Group: 2

Verdict:

input
50
1015 2205 747 1628 2184 61 189...

correct output
94
1 1 17
1 1 30
1 1 15
1 1 3
...

user output
-1
-1
{0: [1015, 2205, 747, 1628, 21...

Test 9

Group: 2

Verdict:

input
50
1936 637 1930 1825 1375 688 23...

correct output
88
1 1 45
1 1 34
1 1 26
1 1 21
...

user output
-1
-1
{0: [1936, 637, 1930, 1825, 13...

Test 10

Group: 2

Verdict: ACCEPTED

input
50
367 944 222 1047 2163 113 1076...

correct output
-1

user output
-1
-1
{0: [367, 944, 222, 1047, 2163...

Test 11

Group: 3

Verdict:

input
500
125877 110081 73003 167540 184...

correct output
986
1 1 222
1 1 325
1 1 203
1 1 73
...

user output
-1
-1
{0: [125877, 110081, 73003, 16...

Test 12

Group: 3

Verdict:

input
500
98396 218927 201855 126130 103...

correct output
983
1 1 80
1 1 125
1 1 242
1 1 85
...

user output
-1
-1
{0: [98396, 218927, 201855, 12...

Test 13

Group: 3

Verdict:

input
500
54508 62242 106667 218403 5323...

correct output
985
1 1 356
1 1 88
1 1 142
1 1 321
...

user output
-1
-1
{0: [54508, 62242, 106667, 218...

Test 14

Group: 3

Verdict:

input
500
108478 62895 206775 78592 2247...

correct output
986
1 1 182
1 1 253
1 1 365
1 1 413
...

user output
-1
-1
{0: [108478, 62895, 206775, 78...

Test 15

Group: 3

Verdict: ACCEPTED

input
500
96354 155542 19613 222634 1530...

correct output
-1

user output
-1
-1
{0: [96354, 155542, 19613, 222...