結果

問題 No.345 最小チワワ問題
コンテスト
ユーザー 濱地航平
提出日時 2026-11-16 11:59:53
言語 Python3
(3.15.2 + numpy 2.5.4 + scipy 1.18.1 + ACL)
コンパイル:
python3 -mpy_compile _filename_
実行:
python3 _filename_
結果
WA  
実行時間 -
コード長 383 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 53 ms
コンパイル使用メモリ 14,720 KB
実行使用メモリ 10,368 KB
最終ジャッジ日時 2026-11-16 11:59:56
合計ジャッジ時間 3,153 ms
ジャッジサーバーID
(参考情報)
judge4_0 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1 WA * 2
other AC * 11 WA * 20
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

s = input()
ans = -1
lst = list(s)
lenth = len(lst)
for index,item in enumerate(lst):
	if item == "c":
		c = index
		for index,item in enumerate(lst):
			if item == "w" and index > c:
				w = index			
				for index,item in enumerate(lst):
					if item == "w" and index > w:
						ww = index
						ans = ww - c
						if item == "w" and index > ww:
							www = index
						
print(ans)
0