結果
| 問題 |
No.345 最小チワワ問題
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-10-09 16:04:58 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 367 bytes |
| コンパイル時間 | 82 ms |
| コンパイル使用メモリ | 12,416 KB |
| 実行使用メモリ | 10,496 KB |
| 最終ジャッジ日時 | 2024-11-17 06:57:58 |
| 合計ジャッジ時間 | 1,803 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 21 WA * 8 |
ソースコード
def main():
S = input()
minlen = 101
text = ''
len_ = 0
for s in S:
if s == 'c':
len_ = 1
text = s
elif s == 'w':
text = text + s
if text == 'cww':
minlen = min(minlen, len_)
len_ += 1
if minlen == 101:
print(-1)
else:
print(minlen)
main()