Task: | Osajono |
Sender: | siirikuoppala |
Submission time: | 2015-10-08 12:12:17 +0300 |
Language: | Python3 |
Status: | READY |
Result: | 0 |
group | verdict | score |
---|---|---|
#1 | WRONG ANSWER | 0 |
#2 | WRONG ANSWER | 0 |
#3 | TIME LIMIT EXCEEDED | 0 |
test | verdict | time | group | |
---|---|---|---|---|
#1 | WRONG ANSWER | 0.08 s | 1 | details |
#2 | WRONG ANSWER | 0.08 s | 1 | details |
#3 | WRONG ANSWER | 0.08 s | 1 | details |
#4 | WRONG ANSWER | 0.09 s | 1 | details |
#5 | WRONG ANSWER | 0.07 s | 1 | details |
#6 | WRONG ANSWER | 0.51 s | 2 | details |
#7 | TIME LIMIT EXCEEDED | -- | 2 | details |
#8 | WRONG ANSWER | 0.07 s | 2 | details |
#9 | WRONG ANSWER | 0.08 s | 2 | details |
#10 | WRONG ANSWER | 0.07 s | 2 | details |
#11 | TIME LIMIT EXCEEDED | -- | 3 | details |
#12 | TIME LIMIT EXCEEDED | -- | 3 | details |
#13 | WRONG ANSWER | 0.10 s | 3 | details |
#14 | WRONG ANSWER | 0.11 s | 3 | details |
#15 | WRONG ANSWER | 0.11 s | 3 | details |
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... |
correct output |
---|
2554 |
user output |
---|
39 17 16 16 17 13 15 16 13 13 14 ... |
Test 2
Group: 1
Verdict: WRONG ANSWER
input |
---|
GDFVYWQCZAFGICSXOSWBZMGPDBSSVL... |
correct output |
---|
299 |
user output |
---|
49 2 2 2 2 2 2 2 2 2 2 2 2 1 2 1 ... |
Test 3
Group: 1
Verdict: WRONG ANSWER
input |
---|
AAAAAAAAAAAAAAAAAAAAAAAAAZAAAA... |
correct output |
---|
4314 |
user output |
---|
9 3 3 3 3 2 3 1 1 1 |
Test 4
Group: 1
Verdict: WRONG ANSWER
input |
---|
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA... |
correct output |
---|
4231 |
user output |
---|
11 5 6 6 4 5 5 1 1 1 1 1 |
Test 5
Group: 1
Verdict: WRONG ANSWER
input |
---|
QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQ... |
correct output |
---|
5050 |
user output |
---|
1 1 |
Test 6
Group: 2
Verdict: WRONG ANSWER
input |
---|
BBABABBBABBAABBABBABAABAAABABA... |
correct output |
---|
6253029 |
user output |
---|
2513 477 874 887 477 874 887 1012 8... |
Test 7
Group: 2
Verdict: TIME LIMIT EXCEEDED
input |
---|
RBKJMLDVQMKHYKCNDIVVKOMFUXTFMG... |
correct output |
---|
485173 |
user output |
---|
(empty) |
Test 8
Group: 2
Verdict: WRONG ANSWER
input |
---|
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA... |
correct output |
---|
12427725 |
user output |
---|
17 8 9 7 8 6 7 5 6 4 5 3 4 2 3 1 ... |
Test 9
Group: 2
Verdict: WRONG ANSWER
input |
---|
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA... |
correct output |
---|
12467549 |
user output |
---|
9 4 5 3 4 2 3 1 1 1 |
Test 10
Group: 2
Verdict: WRONG ANSWER
input |
---|
QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQ... |
correct output |
---|
12502500 |
user output |
---|
1 1 |
Test 11
Group: 3
Verdict: TIME LIMIT EXCEEDED
input |
---|
BAAAAABABBABAABAABABABBBABBAAB... |
correct output |
---|
2500051369 |
user output |
---|
(empty) |
Test 12
Group: 3
Verdict: TIME LIMIT EXCEEDED
input |
---|
ABBURXDRVXAYBPXXOQZNYHLWGUEEWR... |
correct output |
---|
192407124 |
user output |
---|
(empty) |
Test 13
Group: 3
Verdict: WRONG ANSWER
input |
---|
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA... |
correct output |
---|
4998050400 |
user output |
---|
24 11 10 11 9 10 8 9 7 8 6 7 5 6 ... |
Test 14
Group: 3
Verdict: WRONG ANSWER
input |
---|
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA... |
correct output |
---|
4998850144 |
user output |
---|
14 7 6 7 5 6 4 5 3 4 2 3 1 1 1 |
Test 15
Group: 3
Verdict: WRONG ANSWER
input |
---|
QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQ... |
correct output |
---|
5000050000 |
user output |
---|
1 1 |