結果
| 問題 | No.2408 Lakes and Fish | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2023-08-11 21:35:20 | 
| 言語 | PyPy3 (7.3.15) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 370 ms / 2,000 ms | 
| コード長 | 307 bytes | 
| コンパイル時間 | 221 ms | 
| コンパイル使用メモリ | 82,704 KB | 
| 実行使用メモリ | 93,804 KB | 
| 最終ジャッジ日時 | 2024-11-18 15:33:33 | 
| 合計ジャッジ時間 | 6,693 ms | 
| ジャッジサーバーID (参考情報) | judge5 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 19 | 
ソースコード
n,m=map(int,input().split()) L=list(map(int,input().split())) L=[-10**10]+L+[10**10] ans=0 for i in range(m): x,a,b=map(int,input().split()) co=0 for j in reversed(range(60)): co+=2**j if co>=n+2: co-=2**j else: if L[co]>x: co-=2**j ans+=max(a,b-abs(x-L[co]),b-abs(x-L[co+1])) print(ans)
