結果
問題 |
No.345 最小チワワ問題
|
ユーザー |
![]() |
提出日時 | 2022-02-22 10:18:33 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 352 bytes |
コンパイル時間 | 463 ms |
コンパイル使用メモリ | 12,416 KB |
実行使用メモリ | 10,624 KB |
最終ジャッジ日時 | 2024-06-30 11:28:22 |
合計ジャッジ時間 | 2,156 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 15 WA * 14 |
ソースコード
def count_chiwawa(str): count_flg = False count = 0 w_count = 0 for s in list(str): if s == "c": count_flg = True elif s == "w" and count_flg: w_count += 1 if count_flg: count += 1 if w_count == 2: return count return -1 print(count_chiwawa(input()))