結果
| 問題 | No.2796 Small Matryoshka |
| コンテスト | |
| ユーザー |
titia
|
| 提出日時 | 2024-07-30 08:22:20 |
| 言語 | Python3 (3.14.3 + numpy 2.4.4 + scipy 1.17.1) |
| 結果 |
AC
|
| 実行時間 | 486 ms / 2,000 ms |
| + 411µs | |
| コード長 | 393 bytes |
| 記録 | |
| コンパイル時間 | 324 ms |
| コンパイル使用メモリ | 21,668 KB |
| 実行使用メモリ | 57,376 KB |
| 最終ジャッジ日時 | 2026-08-24 17:42:26 |
| 合計ジャッジ時間 | 8,340 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 19 |
ソースコード
import sys
input = sys.stdin.readline
from operator import itemgetter
from heapq import heappop,heappush
N=int(input())
AB=[list(map(int,input().split())) for i in range(N)]
AB.sort(key=itemgetter(0))
H=[]
for a,b in AB:
if H:
if H[0]<=a:
heappop(H)
heappush(H,b)
else:
heappush(H,b)
else:
heappush(H,b)
print(len(H)-1)
titia