結果
問題 |
No.345 最小チワワ問題
|
ユーザー |
![]() |
提出日時 | 2020-08-01 21:03:06 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 380 bytes |
コンパイル時間 | 218 ms |
コンパイル使用メモリ | 81,920 KB |
実行使用メモリ | 52,096 KB |
最終ジャッジ日時 | 2024-07-08 07:36:07 |
合計ジャッジ時間 | 2,129 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 17 WA * 12 |
ソースコード
S = input() c_flg = False finish_flg = False w_count = 0 length = 0 for ch in S: if ch == "c": c_flg = True length = 1 continue if c_flg: length += 1 if ch == "w": w_count += 1 if w_count == 2: finish_flg = True break if finish_flg: print(length) else: print(-1)