| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1043195 | model_code | Bouquet (EGOI24_bouquet) | Pypy 3 | 1295 ms | 91160 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
import bisect
import heapq
N = int(input())
L, R = zip(*(map(int, input().split()) for _ in range(N)))
best = [0]
available = []
for n in range(N):
l = min(L[n], n)
r = min(R[n], N-1-n)
i = bisect.bisect_right(best, n-l)
heapq.heappush(available, (n+r, i, n+1))
while available and available[0][0] == n:
_, i, m = heapq.heappop(available)
if i == len(best):
best.append(m)
else:
best[i] = min(best[i], m)
print(len(best) - 1)
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
