結果
問題 | No.2408 Lakes and Fish |
ユーザー |
![]() |
提出日時 | 2023-08-11 22:08:46 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 169 ms / 2,000 ms |
コード長 | 371 bytes |
コンパイル時間 | 303 ms |
コンパイル使用メモリ | 82,428 KB |
実行使用メモリ | 90,152 KB |
最終ジャッジ日時 | 2024-11-18 16:31:36 |
合計ジャッジ時間 | 4,147 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 19 |
ソースコード
from bisect import bisect_leftimport sysinput = sys.stdin.readlineN, M = map(int, input().split())L = list(map(int, input().split()))ans = 0for _ in range(M):F, B, W = map(int, input().split())k = bisect_left(L, F)res = Bif k > 0:res = max(res, W-(F-L[k-1]))if k < N:res = max(res, W-(L[k]-F))ans += resprint(ans)