結果
| 問題 |
No.345 最小チワワ問題
|
| コンテスト | |
| ユーザー |
nomemsea
|
| 提出日時 | 2019-03-30 16:01:23 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 267 bytes |
| コンパイル時間 | 324 ms |
| コンパイル使用メモリ | 12,672 KB |
| 実行使用メモリ | 10,752 KB |
| 最終ジャッジ日時 | 2024-11-15 17:48:41 |
| 合計ジャッジ時間 | 2,215 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | RE * 3 |
| other | RE * 29 |
ソースコード
S = input()
ans = INF
for i in range(0,len(S)-2):
for j in range(i+2,len(S)):
if S[i] == "c" and S[j] == "w" and S[i:j+1].count("w") == 2:
ans = min(ans,j-i+1)
else:
continue
if ans >100:
print(-1)
else:
print(ans)
nomemsea