結果
| 問題 |
No.345 最小チワワ問題
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2016-02-18 02:50:28 |
| 言語 | Python2 (2.7.18) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 314 bytes |
| コンパイル時間 | 53 ms |
| コンパイル使用メモリ | 6,912 KB |
| 実行使用メモリ | 6,948 KB |
| 最終ジャッジ日時 | 2024-09-22 07:45:45 |
| 合計ジャッジ時間 | 1,407 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 18 WA * 11 |
ソースコード
# -*- coding: utf-8 -*-
S = raw_input()
hit = [-1] * 3
mn = float("inf")
for i, s in enumerate(S):
if s == "c":
hit[0] = i
hit[1] = -1
if s == "w":
if hit[1] != -1:
mn = min(mn, i - hit[0] + 1)
hit[1] = i
if mn == float("inf"):
print -1
else:
print mn