結果
| 問題 | No.345 最小チワワ問題 |
| コンテスト | |
| ユーザー |
object1234
|
| 提出日時 | 2022-02-22 10:18:33 |
| 言語 | Python3 (3.14.3 + numpy 2.4.2 + scipy 1.17.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 352 bytes |
| 記録 | |
| コンパイル時間 | 747 ms |
| コンパイル使用メモリ | 20,824 KB |
| 実行使用メモリ | 15,484 KB |
| 最終ジャッジ日時 | 2026-03-20 10:32:11 |
| 合計ジャッジ時間 | 5,114 ms |
|
ジャッジサーバーID (参考情報) |
judge2_1 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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()))
object1234