結果

問題 No.345 最小チワワ問題
ユーザー 💕💖💞
提出日時 2016-09-10 15:10:48
言語 Python2
(2.7.18)
結果
AC  
実行時間 16 ms / 2,000 ms
コード長 350 bytes
コンパイル時間 306 ms
コンパイル使用メモリ 7,072 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-09-25 11:53:57
合計ジャッジ時間 1,633 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 29
権限があれば一括ダウンロードができます

ソースコード

diff #

import re
line = raw_input().strip()
l4 = []
for i in range(len(line)):
  l0 = re.findall("c.*?w.*?w", line[i:])
  l1 = re.findall("cw.*?w", line[i:])
  l2 = re.findall("c.*?ww", line[i:])
  l3 = re.findall("cww", line[i:])
  l4 = l4 + l0 + l1 + l2 + l3
import sys
#print l4
if len(l4) == 0:
  print -1
  sys.exit(0)
print sorted(map(len, l4)).pop(0)
0