結果
| 問題 | No.345 最小チワワ問題 |
| コンテスト | |
| ユーザー |
あかりき
|
| 提出日時 | 2021-05-24 06:45:00 |
| 言語 | PyPy3 (7.3.23 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 27 ms / 2,000 ms |
| + 588µs | |
| コード長 | 237 bytes |
| 記録 | |
| コンパイル時間 | 67 ms |
| コンパイル使用メモリ | 81,136 KB |
| 実行使用メモリ | 60,416 KB |
| 最終ジャッジ日時 | 2026-09-14 18:11:07 |
| 合計ジャッジ時間 | 3,194 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 29 |
ソースコード
s=list(input())
ans=[]
for i in range(len(s)):
if s[i]=='c':
ct=0
for j in range(i+1,len(s)):
if s[j]=='w':
ct+=1
if ct==2:
ans.append(j-i+1)
break
if ans:
print(min(ans))
else:
print(-1)
あかりき