結果
問題 |
No.345 最小チワワ問題
|
ユーザー |
![]() |
提出日時 | 2017-08-01 14:01:57 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 261 bytes |
コンパイル時間 | 182 ms |
コンパイル使用メモリ | 12,416 KB |
実行使用メモリ | 10,624 KB |
最終ジャッジ日時 | 2024-10-11 05:45:39 |
合計ジャッジ時間 | 2,307 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 9 WA * 20 |
ソースコード
S = list(input()) A = ["c","h","i","w","a","w","a"] Al = 0 ans = 0 for i in range(len(S)): if S[i] == A[Al]: if Al <= 6: A[Al] = i if Al < 6: Al += 1 if type(A[-1]) == int: print(A[-1]-A[0]) else: print("-1")