提出 #1969133
ソースコード 拡げる
import re
def solve(i):
if i.count('2') != i.count('5'):
return -1
else:
for x in range(len(i)):
if re.findall(r"2", i) < re.findall(r"5", i):
return -1
pattern_2 = r"2*"
pattern_5 = r"5*"
count_2 = max(list(map(lambda x: len(x), re.findall(pattern_2, i))))
count_5 = max(list(map(lambda x: len(x), re.findall(pattern_5, i))))
return max(count_2, count_5)
if __name__ == "__main__":
i = input()
print(solve(i))
提出情報
| 提出日時 | |
|---|---|
| 問題 | B - 2525文字列分解 |
| ユーザ | rerost |
| 言語 | Python (3.4.3) |
| 得点 | 0 |
| コード長 | 528 Byte |
| 結果 | WA |
| 実行時間 | 22 ms |
| メモリ | 3316 KiB |
ジャッジ結果
| セット名 | Sample | All | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| 得点 / 配点 | 0 / 0 | 0 / 300 | ||||||||
| 結果 |
|
|
| セット名 | テストケース |
|---|---|
| Sample | 00_example_01.txt, 00_example_02.txt, 00_example_03.txt, 00_example_04.txt |
| All | 00_example_01.txt, 00_example_02.txt, 00_example_03.txt, 00_example_04.txt, 01.txt, 02.txt, 03.txt, 04.txt, 05.txt, 06.txt, 07.txt, 08.txt, 09.txt, 10.txt, 11.txt, 12.txt, 13.txt, 14.txt, 15.txt, 16.txt, 17.txt, 18.txt, 19.txt, 20.txt, 21.txt, 22.txt, 23.txt, 24.txt, 25.txt, 26.txt, 27.txt, 28.txt, 29.txt, 30.txt, 31.txt, 32.txt, 33.txt, 34.txt, 35.txt, 36.txt |
| ケース名 | 結果 | 実行時間 | メモリ |
|---|---|---|---|
| 00_example_01.txt | WA | 22 ms | 3316 KiB |
| 00_example_02.txt | AC | 19 ms | 3188 KiB |
| 00_example_03.txt | WA | 19 ms | 3188 KiB |
| 00_example_04.txt | AC | 19 ms | 3188 KiB |
| 01.txt | WA | 19 ms | 3188 KiB |
| 02.txt | WA | 19 ms | 3188 KiB |
| 03.txt | WA | 19 ms | 3188 KiB |
| 04.txt | WA | 19 ms | 3188 KiB |
| 05.txt | AC | 19 ms | 3188 KiB |
| 06.txt | AC | 19 ms | 3188 KiB |
| 07.txt | AC | 19 ms | 3188 KiB |
| 08.txt | AC | 19 ms | 3188 KiB |
| 09.txt | AC | 19 ms | 3188 KiB |
| 10.txt | WA | 19 ms | 3188 KiB |
| 11.txt | WA | 19 ms | 3188 KiB |
| 12.txt | AC | 19 ms | 3188 KiB |
| 13.txt | AC | 19 ms | 3188 KiB |
| 14.txt | AC | 19 ms | 3188 KiB |
| 15.txt | AC | 19 ms | 3188 KiB |
| 16.txt | AC | 19 ms | 3188 KiB |
| 17.txt | AC | 19 ms | 3188 KiB |
| 18.txt | AC | 19 ms | 3188 KiB |
| 19.txt | AC | 19 ms | 3188 KiB |
| 20.txt | AC | 19 ms | 3188 KiB |
| 21.txt | AC | 19 ms | 3188 KiB |
| 22.txt | AC | 19 ms | 3188 KiB |
| 23.txt | AC | 19 ms | 3188 KiB |
| 24.txt | AC | 19 ms | 3188 KiB |
| 25.txt | AC | 19 ms | 3188 KiB |
| 26.txt | AC | 19 ms | 3188 KiB |
| 27.txt | WA | 19 ms | 3188 KiB |
| 28.txt | WA | 19 ms | 3188 KiB |
| 29.txt | WA | 19 ms | 3188 KiB |
| 30.txt | WA | 19 ms | 3188 KiB |
| 31.txt | WA | 19 ms | 3188 KiB |
| 32.txt | WA | 19 ms | 3188 KiB |
| 33.txt | WA | 19 ms | 3188 KiB |
| 34.txt | WA | 19 ms | 3188 KiB |
| 35.txt | AC | 19 ms | 3188 KiB |
| 36.txt | AC | 18 ms | 3188 KiB |