結果

問題 No.1557 Binary Variable
ユーザー Kiri8128Kiri8128
提出日時 2021-06-25 21:27:26
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 497 ms / 2,000 ms
コード長 241 bytes
コンパイル時間 481 ms
コンパイル使用メモリ 87,224 KB
実行使用メモリ 99,112 KB
最終ジャッジ日時 2023-09-07 14:05:36
合計ジャッジ時間 16,841 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 228 ms
89,172 KB
testcase_01 AC 256 ms
90,200 KB
testcase_02 AC 78 ms
71,456 KB
testcase_03 AC 78 ms
71,084 KB
testcase_04 AC 317 ms
89,448 KB
testcase_05 AC 313 ms
89,400 KB
testcase_06 AC 301 ms
88,428 KB
testcase_07 AC 313 ms
89,412 KB
testcase_08 AC 364 ms
89,360 KB
testcase_09 AC 382 ms
89,356 KB
testcase_10 AC 417 ms
89,192 KB
testcase_11 AC 414 ms
89,176 KB
testcase_12 AC 366 ms
89,196 KB
testcase_13 AC 438 ms
89,748 KB
testcase_14 AC 495 ms
98,948 KB
testcase_15 AC 431 ms
89,724 KB
testcase_16 AC 486 ms
98,792 KB
testcase_17 AC 472 ms
99,112 KB
testcase_18 AC 435 ms
89,684 KB
testcase_19 AC 465 ms
95,984 KB
testcase_20 AC 497 ms
96,604 KB
testcase_21 AC 473 ms
96,648 KB
testcase_22 AC 477 ms
96,300 KB
testcase_23 AC 477 ms
96,804 KB
testcase_24 AC 469 ms
92,960 KB
testcase_25 AC 468 ms
93,932 KB
testcase_26 AC 459 ms
91,292 KB
testcase_27 AC 450 ms
90,588 KB
testcase_28 AC 433 ms
89,596 KB
testcase_29 AC 430 ms
89,736 KB
testcase_30 AC 430 ms
89,548 KB
testcase_31 AC 426 ms
89,816 KB
testcase_32 AC 429 ms
90,088 KB
testcase_33 AC 474 ms
97,208 KB
testcase_34 AC 77 ms
71,072 KB
testcase_35 AC 75 ms
71,228 KB
testcase_36 AC 77 ms
71,108 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N, M = map(int, input().split())
X = []
for _ in range(M):
    l, r = map(int, input().split())
    X.append((l, r))

X.sort(key = lambda x: x[1])
ans = 0
ma = -1
for l, r in X:
    if ma >= l: continue
    ans += 1
    ma = r
print(N - ans)
0