結果

問題 No.2408 Lakes and Fish
ユーザー ShirotsumeShirotsume
提出日時 2023-08-11 21:27:33
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 219 ms / 2,000 ms
コード長 476 bytes
コンパイル時間 229 ms
コンパイル使用メモリ 81,920 KB
実行使用メモリ 91,264 KB
最終ジャッジ日時 2024-04-29 12:16:39
合計ジャッジ時間 4,738 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 49 ms
55,552 KB
testcase_01 AC 48 ms
55,296 KB
testcase_02 AC 45 ms
55,040 KB
testcase_03 AC 46 ms
55,424 KB
testcase_04 AC 163 ms
90,848 KB
testcase_05 AC 171 ms
90,752 KB
testcase_06 AC 177 ms
90,240 KB
testcase_07 AC 217 ms
91,264 KB
testcase_08 AC 219 ms
91,036 KB
testcase_09 AC 214 ms
91,264 KB
testcase_10 AC 212 ms
91,264 KB
testcase_11 AC 159 ms
81,152 KB
testcase_12 AC 171 ms
87,656 KB
testcase_13 AC 117 ms
79,616 KB
testcase_14 AC 146 ms
81,024 KB
testcase_15 AC 183 ms
85,932 KB
testcase_16 AC 126 ms
83,072 KB
testcase_17 AC 114 ms
78,080 KB
testcase_18 AC 153 ms
84,736 KB
testcase_19 AC 189 ms
83,200 KB
testcase_20 AC 185 ms
77,568 KB
testcase_21 AC 191 ms
84,992 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys, time, random
from collections import deque, Counter, defaultdict
input = lambda: sys.stdin.readline().rstrip()
ii = lambda: int(input())
mi = lambda: map(int, input().split())
li = lambda: list(mi())
inf = 2 ** 63 - 1
mod = 998244353
import bisect
n, m = mi()

l = li()
l.sort()
l.insert(0,-inf)
l.append(inf)
ans = 0
for i in range(m):
    f, b, w = mi()
    ans += max(b, w - abs(l[bisect.bisect(l, f)] - f), w - abs(l[bisect.bisect(l, f) - 1] - f))

print(ans)
0