結果
| 問題 | No.2408 Lakes and Fish |
| コンテスト | |
| ユーザー |
ikoma
|
| 提出日時 | 2023-08-11 21:55:53 |
| 言語 | PyPy3 (7.3.23 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 127 ms / 2,000 ms |
| + 223µs | |
| コード長 | 357 bytes |
| 記録 | |
| コンパイル時間 | 84 ms |
| コンパイル使用メモリ | 82,004 KB |
| 実行使用メモリ | 100,280 KB |
| 最終ジャッジ日時 | 2026-09-25 22:52:50 |
| 合計ジャッジ時間 | 5,573 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 19 |
ソースコード
import sys
input = sys.stdin.readline
from bisect import bisect_left
N,M=map(int,input().split())
L=[-(1<<60)]+list(map(int,input().split()))+[1<<60]
FBW=[list(map(int,input().split())) for _ in range(M)]
ans=0
for f,b,w in FBW:
i = bisect_left(L, f)
if L[i]==f:
ans += w
else:
ans += max(b, w-(f-L[i-1]), w-(L[i]-f))
print(ans)
ikoma