AtCoder Beginner Contest 019

Submission #6923430

Source codeソースコード

s = input()
n = len(s)
cnt = 1
L = []
for i in range(n-1):
  if s[i] == s[i+1]:
    cnt += 1
  else:
    L += [s[i]]
    L += [str(cnt)]
    cnt = 1
if s[n-2] == s[n-1]:
  a = int(L[-1])+1
  L[-1] = str(a)
else:
  L += [s[n-1]]
  L += ["1"]
 
print(''.join(L))    
    
    
  

Submission

Task問題 B - 高橋くんと文字列圧縮
User nameユーザ名 jammq123
Created time投稿日時
Language言語 Python3 (3.4.3)
Status状態 RE
Score得点 0
Source lengthソースコード長 298 Byte
File nameファイル名
Exec time実行時間 ms
Memory usageメモリ使用量 -

Test case

Set

Set name Score得点 / Max score Cases
Sample - subtask0_1.txt,subtask0_2.txt,subtask0_3.txt
All 0 / 100 0.txt,1.txt,10.txt,11.txt,12.txt,13.txt,14.txt,15.txt,16.txt,17.txt,18.txt,19.txt,2.txt,20.txt,21.txt,22.txt,23.txt,24.txt,25.txt,26.txt,27.txt,28.txt,29.txt,3.txt,4.txt,5.txt,6.txt,7.txt,8.txt,9.txt,subtask0_1.txt,subtask0_2.txt,subtask0_3.txt

Test case

Case name Status状態 Exec time実行時間 Memory usageメモリ使用量
0.txt AC 18 ms 3064 KB
1.txt AC 18 ms 3064 KB
10.txt WA
11.txt WA
12.txt WA
13.txt WA
14.txt WA
15.txt WA
16.txt WA
17.txt WA
18.txt WA
19.txt WA
2.txt AC 18 ms 3064 KB
20.txt WA
21.txt WA
22.txt WA
23.txt RE
24.txt WA
25.txt WA
26.txt RE
27.txt RE
28.txt WA
29.txt WA
3.txt AC 18 ms 3060 KB
4.txt AC 18 ms 3064 KB
5.txt AC 18 ms 3064 KB
6.txt AC 18 ms 3060 KB
7.txt AC 18 ms 3060 KB
8.txt AC 18 ms 3064 KB
9.txt AC 18 ms 3064 KB
subtask0_1.txt AC 17 ms 3064 KB
subtask0_2.txt AC 17 ms 3060 KB
subtask0_3.txt AC 17 ms 3064 KB