結果
問題 |
No.345 最小チワワ問題
|
ユーザー |
![]() |
提出日時 | 2017-10-03 22:43:59 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 550 bytes |
コンパイル時間 | 81 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 10,752 KB |
最終ジャッジ日時 | 2024-11-16 06:05:57 |
合計ジャッジ時間 | 1,924 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 16 WA * 13 |
ソースコード
s = input() c = False cpos = 0 w = False li = [] for i, v in enumerate(s): if c and w: if v == "c": c = False w = False cpos = 0 continue if v == "w": li.append(i - cpos) elif c: if v == "c": c = False w = False cpos = 0 continue elif v == "w": w = True else: if v == "c": cpos = i c = True if len(li) >= 1: print(min(li) + 1) else: print('-1')