結果
| 問題 |
No.345 最小チワワ問題
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-04-04 15:15:15 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 216 bytes |
| コンパイル時間 | 171 ms |
| コンパイル使用メモリ | 82,036 KB |
| 実行使用メモリ | 54,228 KB |
| 最終ジャッジ日時 | 2024-11-25 06:45:49 |
| 合計ジャッジ時間 | 2,121 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 WA * 2 |
| other | AC * 8 WA * 21 |
ソースコード
S = input()
c = S.find("c")
w_1_idx = S.find("w", c)
c_idx = S.rfind("c", w_1_idx)
w_2_idx = S.find("w", w_1_idx+1)
if c_idx != -1 and w_1_idx != -1 and w_2_idx != -1:
print(w_2_idx-c_idx+1)
else :
print(-1)