結果
| 問題 |
No.345 最小チワワ問題
|
| コンテスト | |
| ユーザー |
gya9_
|
| 提出日時 | 2018-07-19 19:14:25 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 397 bytes |
| コンパイル時間 | 116 ms |
| コンパイル使用メモリ | 12,800 KB |
| 実行使用メモリ | 10,752 KB |
| 最終ジャッジ日時 | 2024-12-24 07:29:47 |
| 合計ジャッジ時間 | 1,763 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 14 WA * 15 |
ソースコード
import sys
S = input()
# S = "wachiwachi"
cpos = [i for i, x in enumerate(S) if x == "c"]
wpos = [i for i, x in enumerate(S) if x == "w"]
ans = -1
if len(cpos) == 0 or len(wpos) <= 1:
print(-1)
sys.exit()
for i in cpos:
wpostemp = [j for j in wpos if j > i]
if len(wpostemp) <= 1:
break
if ans < wpostemp[1] - i + 1:
ans = wpostemp[1] - i + 1
print(ans)
gya9_