結果
| 問題 | No.345 最小チワワ問題 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2016-10-09 08:32:22 |
| 言語 | Python3 (3.14.2 + numpy 2.4.0 + scipy 1.16.3) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 342 bytes |
| 記録 | |
| コンパイル時間 | 86 ms |
| コンパイル使用メモリ | 12,544 KB |
| 実行使用メモリ | 10,752 KB |
| 最終ジャッジ日時 | 2024-11-21 20:42:26 |
| 合計ジャッジ時間 | 2,008 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 15 WA * 14 |
ソースコード
N = input()
s = []
N_flg = 1
m = n = 0
for i, n in enumerate(N):
if n == "c" and N_flg == 1:
m = i
N_flg = 2
elif n == "c" and N_flg == 2:
n = i
elif n == "w" and N_flg == 2:
N_flg = 3
elif n == "w" and N_flg == 3:
s += [i - m + 1]
N_flg = 1
print(min(s) if len(s) != 0 else -1)