Code Submission Evaluation System Login

Datatähti 2016 alku

Start:2015-09-28 00:00:00
End:2015-10-12 00:00:00
 

Tasks | Scoreboard | Statistics


CSES - Datatähti 2016 alku - Results
History
2015-12-03 15:51:390
2015-12-03 15:41:520
2015-10-08 12:12:170
2015-09-30 12:23:030
2015-09-29 21:32:380
2015-09-29 21:30:590
2015-09-29 21:29:040
2015-09-29 20:31:41100
2015-09-29 20:28:010
2015-09-29 20:27:520
2015-09-29 20:24:320
2015-09-29 20:12:1512
2015-09-29 20:11:520
2015-09-29 19:58:500
Task:Osajono
Sender:siirikuoppala
Submission time:2015-10-08 12:12:17
Language:Python3
Status:READY
Score:0

Feedback

groupverdictscore
#1WRONG ANSWER0
#2WRONG ANSWER0
#3TIME LIMIT EXCEEDED0

Test results

testverdicttime (s)group
#1WRONG ANSWER0.08 / 1.001details
#2WRONG ANSWER0.08 / 1.001details
#3WRONG ANSWER0.08 / 1.001details
#4WRONG ANSWER0.09 / 1.001details
#5WRONG ANSWER0.07 / 1.001details
#6WRONG ANSWER0.51 / 1.002details
#7TIME LIMIT EXCEEDED-- / 1.002details
#8WRONG ANSWER0.07 / 1.002details
#9WRONG ANSWER0.08 / 1.002details
#10WRONG ANSWER0.07 / 1.002details
#11TIME LIMIT EXCEEDED-- / 1.003details
#12TIME LIMIT EXCEEDED-- / 1.003details
#13WRONG ANSWER0.10 / 1.003details
#14WRONG ANSWER0.11 / 1.003details
#15WRONG ANSWER0.11 / 1.003details

Code

'''
Created on 30.9.2015

@author: siiri
'''

bitit = str(input())

def muuna():
    k=1
    joku=[]
    for i in range(1, len(bitit)):
        if bitit[i] == bitit[i-1]:
            k+=1
        else:
            if k > 1:
                joku.append(1)
            if k < 2:
                joku.append(0)
            k = 1
        if i == len(bitit)-1:
            if k>1:
                joku.append(1)
            else:
                joku.append(0)
    
    return(joku)

joku = muuna()

def yks(joku, teko):
    joku = dele(1)
    teko.append(1)
    return(teko, joku)

def dele(lol):
    if lol>0 and lol < len(joku)-1:
        joku.pop(lol-1)
        joku.pop(lol-1)
        joku.pop(lol-1)
        joku.insert(lol-1, 1)
    elif lol ==0:
        joku.remove(joku[lol])
    else:
        joku[lol]=5
        joku.remove(5)
    return joku
def pisinnol():
    i=0
    d = 0
    a=0
    g=0
    yk=0
    b=len(joku)
    while i < b:
        if joku[i] == 0:
            if d==0:
                g=i
            d+=1
        else:
            if d>a:
                a=d
                gg=g
                YK=yk
            elif d==a:
                e=b/2
                if i <= e:
                    a=d
                    gg=g
                    YK=yk
                elif i > e and i-e < e-gg:
                    a=d
                    gg=g
                    YK=yk
            d=0
            yk+=1
        i+=1
    if d>a:
        a=d
        gg=g
        YK=yk
    return gg,a, YK, yk
def Mm(joku, teko):
    gg, a, f, yk = pisinnol()
    g = yk-f
    if f<g:
        s=gg+a
        teko += str(f+1)
        teko += " "
        joku=dele(s)
    else:
        s=gg-1
        teko += str(f)
        teko += " "
        joku=dele(s)
    return teko, joku
            
teko = ""
f = 0
while 1 in joku:
    if 0 not in joku:
        r=len(joku)
        while r>0:
            joku.remove(1)
            teko += "1"
            teko += " "
            r-=2
    else:
        teko, joku = Mm(joku, teko)

    
def prin():
    if len(joku) > 0:
        print("QAQ")
    else:
        print(int(len(teko)/2))
        hei = ""
        for q in teko:
            hei += str(q)
            hei += " "
        hei.rstrip()
        print(teko)    

prin()





Test details

Test 1

Group: 1

Verdict: WRONG ANSWER

input
BBBAABBBAAAABBAAAABAABAABBBBBB...
view   save

correct output
2554

view   save

user output
39
17 16 16 17 13 15 16 13 13 14 ...
view   save

Test 2

Group: 1

Verdict: WRONG ANSWER

input
GDFVYWQCZAFGICSXOSWBZMGPDBSSVL...
view   save

correct output
299

view   save

user output
49
2 2 2 2 2 2 2 2 2 2 2 2 1 2 1 ...
view   save

Test 3

Group: 1

Verdict: WRONG ANSWER

input
AAAAAAAAAAAAAAAAAAAAAAAAAZAAAA...
view   save

correct output
4314

view   save

user output
9
3 3 3 3 2 3 1 1 1 

view   save

Test 4

Group: 1

Verdict: WRONG ANSWER

input
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA...
view   save

correct output
4231

view   save

user output
11
5 6 6 4 5 5 1 1 1 1 1 

view   save

Test 5

Group: 1

Verdict: WRONG ANSWER

input
QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQ...
view   save

correct output
5050

view   save

user output
1


view   save

Test 6

Group: 2

Verdict: WRONG ANSWER

input
BBABABBBABBAABBABBABAABAAABABA...
view   save

correct output
6253029

view   save

user output
2513
477 874 887 477 874 887 1012 8...
view   save

Test 7

Group: 2

Verdict: TIME LIMIT EXCEEDED

input
RBKJMLDVQMKHYKCNDIVVKOMFUXTFMG...
view   save

correct output
485173

view   save

user output
(empty)

Test 8

Group: 2

Verdict: WRONG ANSWER

input
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA...
view   save

correct output
12427725

view   save

user output
17
8 9 7 8 6 7 5 6 4 5 3 4 2 3 1 ...
view   save

Test 9

Group: 2

Verdict: WRONG ANSWER

input
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA...
view   save

correct output
12467549

view   save

user output
9
4 5 3 4 2 3 1 1 1 

view   save

Test 10

Group: 2

Verdict: WRONG ANSWER

input
QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQ...
view   save

correct output
12502500

view   save

user output
1


view   save

Test 11

Group: 3

Verdict: TIME LIMIT EXCEEDED

input
BAAAAABABBABAABAABABABBBABBAAB...
view   save

correct output
2500051369

view   save

user output
(empty)

Test 12

Group: 3

Verdict: TIME LIMIT EXCEEDED

input
ABBURXDRVXAYBPXXOQZNYHLWGUEEWR...
view   save

correct output
192407124

view   save

user output
(empty)

Test 13

Group: 3

Verdict: WRONG ANSWER

input
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA...
view   save

correct output
4998050400

view   save

user output
24
11 10 11 9 10 8 9 7 8 6 7 5 6 ...
view   save

Test 14

Group: 3

Verdict: WRONG ANSWER

input
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA...
view   save

correct output
4998850144

view   save

user output
14
7 6 7 5 6 4 5 3 4 2 3 1 1 1 

view   save

Test 15

Group: 3

Verdict: WRONG ANSWER

input
QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQ...
view   save

correct output
5000050000

view   save

user output
1


view   save