結果
問題 |
No.1435 Mmm......
|
ユーザー |
|
提出日時 | 2021-08-21 00:07:43 |
言語 | PyPy3 (7.3.15) |
結果 |
TLE
|
実行時間 | - |
コード長 | 262 bytes |
コンパイル時間 | 168 ms |
コンパイル使用メモリ | 82,452 KB |
実行使用メモリ | 112,404 KB |
最終ジャッジ日時 | 2024-10-14 08:44:56 |
合計ジャッジ時間 | 5,083 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 2 TLE * 1 -- * 21 |
ソースコード
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)