結果
| 問題 | No.345 最小チワワ問題 |
| コンテスト | |
| ユーザー |
Ohnuma
|
| 提出日時 | 2020-04-10 10:30:16 |
| 言語 | Python3 (3.14.7 + numpy 2.5.2 + scipy 1.18.0 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 94 ms / 2,000 ms |
| + 689µs | |
| コード長 | 279 bytes |
| 記録 | |
| コンパイル時間 | 1,050 ms |
| コンパイル使用メモリ | 21,280 KB |
| 実行使用メモリ | 15,864 KB |
| 最終ジャッジ日時 | 2026-08-27 08:52:02 |
| 合計ジャッジ時間 | 6,029 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 29 |
ソースコード
s = input()
ret = float('inf')
for i in range(len(s)+1):
for j in range(i+1, len(s)+1):
t = s[i:j]
if t.count('c')>=1 and t.count('w')>=2:
if t.index('c')<t.index('w'):
ret = min(ret, len(t))
print(ret if ret!=float('inf') else -1)
Ohnuma