結果

問題 No.1435 Mmm......
ユーザー kojihashimoto-kobe
提出日時 2021-08-21 00:09:42
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
TLE  
実行時間 -
コード長 262 bytes
コンパイル時間 312 ms
コンパイル使用メモリ 12,800 KB
実行使用メモリ 33,836 KB
最終ジャッジ日時 2024-10-14 08:46:57
合計ジャッジ時間 4,279 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 2 TLE * 1 -- * 21
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
a = list(map(int, input().split())) +[10**18]
ans = 0
for l in range(n-1):
  L = l+1
  R = n
  while R-L>1:
    m = (R+L)//2
    tmp = sorted(a[l:m+1])
    if tmp[-1] <= tmp[0]+tmp[1]:
      L = m
    else:
      R = m
  ans += L - l

print(ans)
0