結果

問題 No.1557 Binary Variable
ユーザー brthyyjpbrthyyjp
提出日時 2021-06-27 16:40:06
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 460 ms / 2,000 ms
コード長 276 bytes
コンパイル時間 317 ms
コンパイル使用メモリ 87,288 KB
実行使用メモリ 99,140 KB
最終ジャッジ日時 2023-09-07 18:04:14
合計ジャッジ時間 15,476 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 218 ms
89,116 KB
testcase_01 AC 228 ms
91,344 KB
testcase_02 AC 72 ms
71,260 KB
testcase_03 AC 71 ms
71,056 KB
testcase_04 AC 309 ms
89,568 KB
testcase_05 AC 303 ms
89,548 KB
testcase_06 AC 293 ms
88,212 KB
testcase_07 AC 300 ms
89,568 KB
testcase_08 AC 353 ms
89,732 KB
testcase_09 AC 366 ms
89,452 KB
testcase_10 AC 403 ms
89,612 KB
testcase_11 AC 403 ms
89,796 KB
testcase_12 AC 354 ms
89,476 KB
testcase_13 AC 409 ms
89,544 KB
testcase_14 AC 453 ms
99,012 KB
testcase_15 AC 408 ms
89,764 KB
testcase_16 AC 455 ms
99,032 KB
testcase_17 AC 453 ms
99,140 KB
testcase_18 AC 433 ms
98,960 KB
testcase_19 AC 445 ms
95,936 KB
testcase_20 AC 454 ms
96,632 KB
testcase_21 AC 460 ms
96,832 KB
testcase_22 AC 453 ms
96,140 KB
testcase_23 AC 449 ms
96,924 KB
testcase_24 AC 436 ms
92,948 KB
testcase_25 AC 443 ms
93,904 KB
testcase_26 AC 437 ms
91,256 KB
testcase_27 AC 432 ms
90,408 KB
testcase_28 AC 407 ms
89,952 KB
testcase_29 AC 417 ms
89,820 KB
testcase_30 AC 406 ms
89,988 KB
testcase_31 AC 413 ms
89,828 KB
testcase_32 AC 415 ms
89,924 KB
testcase_33 AC 450 ms
97,204 KB
testcase_34 AC 71 ms
71,388 KB
testcase_35 AC 72 ms
71,052 KB
testcase_36 AC 71 ms
71,252 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n, m = map(int, input().split())
LR = []
for i in range(m):
    l, r = map(int, input().split())
    l, r = l-1, r-1
    LR.append((l, r))

LR.sort(key=lambda x: x[1])
cnt = 0
curR = -1
for l, r in LR:
    if l <= curR:
        continue
    curR = r
    cnt += 1
print(n-cnt)
0