結果

問題 No.345 最小チワワ問題
ユーザー ic__e
提出日時 2022-12-10 20:12:44
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 280 bytes
コンパイル時間 433 ms
コンパイル使用メモリ 12,416 KB
実行使用メモリ 10,496 KB
最終ジャッジ日時 2024-10-14 23:54:05
合計ジャッジ時間 2,244 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2 WA * 1
other AC * 21 WA * 8
権限があれば一括ダウンロードができます

ソースコード

diff #

# 最小チワワ問題
str = input()
wCount = 0
ans = 100

for n,sc in enumerate(str):
  wCount=0
  length=1
  if(sc=='c'):
    for sw in str[n+1:]:
      length+=1
      if(sw=='w'):
        wCount+=1
      if(wCount==2):
        if(ans>length):
          ans=length
print(ans)
0