結果
| 問題 |
No.759 悪くない忘年会にしような!
|
| コンテスト | |
| ユーザー |
mkawa2
|
| 提出日時 | 2021-02-05 18:16:45 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
AC
|
| 実行時間 | 707 ms / 2,000 ms |
| コード長 | 1,467 bytes |
| コンパイル時間 | 208 ms |
| コンパイル使用メモリ | 12,928 KB |
| 実行使用メモリ | 45,760 KB |
| 最終ジャッジ日時 | 2024-07-02 08:37:50 |
| 合計ジャッジ時間 | 15,083 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 64 |
ソースコード
import sys
sys.setrecursionlimit(10**6)
int1 = lambda x: int(x)-1
p2D = lambda x: print(*x, sep="\n")
def II(): return int(sys.stdin.buffer.readline())
def MI(): return map(int, sys.stdin.buffer.readline().split())
def MI1(): return map(int1, sys.stdin.buffer.readline().split())
def LI(): return list(map(int, sys.stdin.buffer.readline().split()))
def LI1(): return list(map(int1, sys.stdin.buffer.readline().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def BI(): return sys.stdin.buffer.readline().rstrip()
def SI(): return sys.stdin.buffer.readline().rstrip().decode()
# dij = [(0, 1), (-1, 0), (0, -1), (1, 0)]
dij = [[(-1, 0), (1, 0)], [(0, -1), (0, 1)]]
inf = 10**16
# md = 998244353
md = 10**9+7
class BitMax:
def __init__(self, n):
self.inf=10**9
self.n = n + 3
self.table = [-self.inf] * (self.n + 1)
def update(self, i, x):
i += 1
while i <= self.n:
if x > self.table[i]: self.table[i] = x
i += i & -i
def max(self, i):
i += 1
res = -self.inf
while i > 0:
if self.table[i] > res: res = self.table[i]
i -= i & -i
return res
mx=10005
bit=BitMax(mx)
n=II()
xyz=LLI(n)
xyzi=[(x,y,z,i+1) for i,(x,y,z) in enumerate(xyz)]
xyzi.sort(reverse=True)
ans=[]
for x,y,z,i in xyzi:
y=mx-y
pz=bit.max(y)
if z>pz:
ans.append(i)
bit.update(y,z)
ans.sort()
print(*ans,sep="\n")
mkawa2