結果

問題 No.341 沈黙の期間
ユーザー hrgnhrgn
提出日時 2019-03-06 01:37:43
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 137 ms / 5,000 ms
コード長 353 bytes
コンパイル時間 450 ms
コンパイル使用メモリ 10,628 KB
実行使用メモリ 29,708 KB
最終ジャッジ日時 2023-09-05 19:02:02
合計ジャッジ時間 4,735 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 134 ms
29,388 KB
testcase_01 AC 132 ms
29,652 KB
testcase_02 AC 136 ms
29,504 KB
testcase_03 AC 134 ms
29,496 KB
testcase_04 AC 132 ms
29,708 KB
testcase_05 AC 135 ms
29,472 KB
testcase_06 AC 137 ms
29,572 KB
testcase_07 AC 135 ms
29,452 KB
testcase_08 AC 135 ms
29,464 KB
testcase_09 AC 136 ms
29,564 KB
testcase_10 AC 135 ms
29,504 KB
testcase_11 AC 134 ms
29,616 KB
testcase_12 AC 134 ms
29,492 KB
testcase_13 AC 134 ms
29,568 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import numpy as np

s = input()
lst = [-1] + [i for i in range(len(s)) if s[i] != "…"] + [len(s)]

print(max(np.diff(lst) - 1))

'''
"…"以外の文字の出現位置をlstに記録。
たとえばx, yがlstの連続要素だとすると
x+1文字目からy-1文字目までは"…"ということになる。
その長さは
(y-1)-(x+1)+1=y-x-1
'''
0