CSES - Datatähti 2016 alku - Results
Submission details
Task:Osajono
Sender:MrAurela
Submission time:2015-10-08 07:20:15 +0300
Language:Python2
Status:READY
Result:0
Feedback
groupverdictscore
#10
#20
#30
Test results
testverdicttimegroup
#10.04 s1details
#20.05 s1details
#30.06 s1details
#40.06 s1details
#50.06 s1details
#60.05 s2details
#70.05 s2details
#80.05 s2details
#90.04 s2details
#100.07 s2details
#110.04 s3details
#120.06 s3details
#130.06 s3details
#140.06 s3details
#150.05 s3details

Code

# -*- coding: cp1252 -*-

n = int(raw_input()) #Luetaan ensimmäinen rivi

luvut=[]
parit=[]
syote1 = [int(x) for x in raw_input().split(" ")] #Luetaan toinen rivi
syote2 = [int(x) for x in raw_input().split(" ")] #Luetaan kolmas rivi
for i in range(n):
    luvut.append(i+1)
    parit.append([])
    parit[i].append(syote1[i])
    parit[i].append(syote2[i])

vaikeat2=[parit[n-2][0], parit[n-2][1]] #toiseksi viimeinen sarake
vaikeat1=[parit[n-1][0], parit[n-1][1]] #viimeinen sarake

#D print "parit:", parit
#D print "luvut:", luvut
#D print "vaikeat:", vaikeat

#[y for y in vaikeat1 if y != luku]

vastaus = []
for paikka in range(n):
    print "Luvut:", luvut
    print "vaikeat:", vaikeat1, vaikeat2
    print
    jatka=True
    if jatka:
        for luku in vaikeat1:
            if (luku not in parit[paikka]):
                vastaus.append(luku)
                vaikeat1.remove(luku) #poistetaan (luku) vaikeista
                if luku in vaikeat2: vaikeat2.remove(luku)
                if luku in luvut: luvut.remove(luku)
                jatka=False
                break
    if jatka:
        for luku in vaikeat2:
            if (luku not in parit[paikka]):
                vastaus.append(luku)
                vaikeat2.remove(luku) #poistetaan (luku) vaikeista
                if luku in vaikeat1: vaikeat1.remove(luku)
                if luku in luvut: luvut.remove(luku)
                jatka=False
                break   
    if jatka:          
        for luku in luvut:
            if (luku not in parit[paikka]):
                vastaus.append(luku)
                luvut.remove(luku)
                break

#if len(vastaus)<n:
#    raise ValueError
print " ".join(str(x) for x in vastaus)

Test details

Test 1

Group: 1

Verdict:

input
BBBAABBBAAAABBAAAABAABAABBBBBB...

correct output
2554

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 3, in <module>
    n = int(raw_input()) #Luetaan ensimmäinen rivi
ValueError: invalid literal for int() with base 10: 'BBBAABBBAAAABBAAAABAABAABBBBBBAABBBBBAAABAAABABAABBABBAAABABABABBABBBBABABAABBAAABBBBABBBBAABBAABAAA'

Test 2

Group: 1

Verdict:

input
GDFVYWQCZAFGICSXOSWBZMGPDBSSVL...

correct output
299

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 3, in <module>
    n = int(raw_input()) #Luetaan ensimmäinen rivi
ValueError: invalid literal for int() with base 10: 'GDFVYWQCZAFGICSXOSWBZMGPDBSSVLFMEYWRESVQFYWMOLSCEADYZHZIIYEJVIPCLSFMYNKXTOWYSRDPDVNLQNLFPSXVHYKKWHZW'

Test 3

Group: 1

Verdict:

input
AAAAAAAAAAAAAAAAAAAAAAAAAZAAAA...

correct output
4314

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 3, in <module>
    n = int(raw_input()) #Luetaan ensimmäinen rivi
ValueError: invalid literal for int() with base 10: 'AAAAAAAAAAAAAAAAAAAAAAAAAZAAAAZAZAZAAAAAAAAAAAAAAAAAAAAAZZAAAAAAAAAAAZAAAAAZAAAAAAAAAAAAAAAAAAAAAAAA'

Test 4

Group: 1

Verdict:

input
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA...

correct output
4231

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 3, in <module>
    n = int(raw_input()) #Luetaan ensimmäinen rivi
ValueError: invalid literal for int() with base 10: 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAZZAAAAAAZAAAAZAAAAAZAAAAAAAAZAAAAAAAAAAAZAAAZAAAAAAAAAAAAAZAAAA'

Test 5

Group: 1

Verdict:

input
QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQ...

correct output
5050

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 3, in <module>
    n = int(raw_input()) #Luetaan ensimmäinen rivi
ValueError: invalid literal for int() with base 10: 'QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQ'

Test 6

Group: 2

Verdict:

input
BBABABBBABBAABBABBABAABAAABABA...

correct output
6253029

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 3, in <module>
    n = int(raw_input()) #Luetaan ensimmäinen rivi
ValueError: invalid literal for int() with base 10: 'BBABABBBABBAABBABBABAABAAABABAABBBAABAABBBBBBBAABBABBBABBABBAAABBAABABABBABBBBBABBBBBBBABABABBBAABBABABAAABBBAABABBABBBBABBBABBBAABBBABBBBBBBAAABAAAABAABBBBAAABABBBABAABBBBABABAABAAABAABBABABAAAABBAAA'

Test 7

Group: 2

Verdict:

input
RBKJMLDVQMKHYKCNDIVVKOMFUXTFMG...

correct output
485173

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 3, in <module>
    n = int(raw_input()) #Luetaan ensimmäinen rivi
ValueError: invalid literal for int() with base 10: 'RBKJMLDVQMKHYKCNDIVVKOMFUXTFMGICWVUWKXCYRWJQMRSLJNGZTCGMDCQVTPWAYSXXVTCYJEYQCUUPTWKJBHZXVVGBEJOOYDSHTLKXHWCMKCHREGXSGDYECFJMMWEGCWSHWWWDIXJEGJSRLNMTQEJDAVMAFQPOZSLNWVWUDQWTKNMGIUFTDVDMLZIHVEMQHVCWJSED'

Test 8

Group: 2

Verdict:

input
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA...

correct output
12427725

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 3, in <module>
    n = int(raw_input()) #Luetaan ensimmäinen rivi
ValueError: invalid literal for int() with base 10: 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAZAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA'

Test 9

Group: 2

Verdict:

input
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA...

correct output
12467549

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 3, in <module>
    n = int(raw_input()) #Luetaan ensimmäinen rivi
ValueError: invalid literal for int() with base 10: 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA'

Test 10

Group: 2

Verdict:

input
QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQ...

correct output
12502500

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 3, in <module>
    n = int(raw_input()) #Luetaan ensimmäinen rivi
ValueError: invalid literal for int() with base 10: 'QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQ'

Test 11

Group: 3

Verdict:

input
BAAAAABABBABAABAABABABBBABBAAB...

correct output
2500051369

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 3, in <module>
    n = int(raw_input()) #Luetaan ensimmäinen rivi
ValueError: invalid literal for int() with base 10: 'BAAAAABABBABAABAABABABBBABBAABBBABBBABBBBBABBBBAAAAAABABAAAAAAABAABAABABBBAAABABAAAABABABAABBAAAABABAAABABBBBABBBBABABAAAAAABAAABBBBBBABBAAAABABABAABBABABAAABBBAABBAABABBABABAABABABBBBBABBBABAABAABABB'

Test 12

Group: 3

Verdict:

input
ABBURXDRVXAYBPXXOQZNYHLWGUEEWR...

correct output
192407124

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 3, in <module>
    n = int(raw_input()) #Luetaan ensimmäinen rivi
ValueError: invalid literal for int() with base 10: 'ABBURXDRVXAYBPXXOQZNYHLWGUEEWRNOMCJGFEMRRSCURKRFGMOLHWBPJQSREDUVUHRESNQNYKFMBSNIUTFFZWALMYHECUOTYXVDYMLZYZCYDMYIKGCYYXXTNGJDCZPYFGHDBCPZCFWSJOCGXMJAFNIKHPBMNUZCDHYNEGXSPHYGIUXWIKQFKLYCXKNHDYCGUECOFTPT'

Test 13

Group: 3

Verdict:

input
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA...

correct output
4998050400

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 3, in <module>
    n = int(raw_input()) #Luetaan ensimmäinen rivi
ValueError: invalid literal for int() with base 10: 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA'

Test 14

Group: 3

Verdict:

input
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA...

correct output
4998850144

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 3, in <module>
    n = int(raw_input()) #Luetaan ensimmäinen rivi
ValueError: invalid literal for int() with base 10: 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA'

Test 15

Group: 3

Verdict:

input
QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQ...

correct output
5000050000

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 3, in <module>
    n = int(raw_input()) #Luetaan ensimmäinen rivi
ValueError: invalid literal for int() with base 10: 'QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQ'