結果

問題 No.1557 Binary Variable
ユーザー NatsubiSoganNatsubiSogan
提出日時 2021-06-25 22:25:12
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 539 ms / 2,000 ms
コード長 245 bytes
コンパイル時間 947 ms
コンパイル使用メモリ 87,008 KB
実行使用メモリ 108,544 KB
最終ジャッジ日時 2023-09-07 14:38:33
合計ジャッジ時間 18,549 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 259 ms
97,156 KB
testcase_01 AC 284 ms
102,432 KB
testcase_02 AC 73 ms
71,540 KB
testcase_03 AC 73 ms
71,344 KB
testcase_04 AC 354 ms
98,692 KB
testcase_05 AC 362 ms
98,596 KB
testcase_06 AC 350 ms
98,712 KB
testcase_07 AC 345 ms
98,840 KB
testcase_08 AC 400 ms
98,668 KB
testcase_09 AC 426 ms
98,644 KB
testcase_10 AC 458 ms
98,276 KB
testcase_11 AC 463 ms
98,400 KB
testcase_12 AC 414 ms
98,696 KB
testcase_13 AC 459 ms
98,632 KB
testcase_14 AC 493 ms
99,196 KB
testcase_15 AC 467 ms
98,460 KB
testcase_16 AC 487 ms
99,240 KB
testcase_17 AC 492 ms
99,280 KB
testcase_18 AC 480 ms
98,408 KB
testcase_19 AC 533 ms
107,456 KB
testcase_20 AC 530 ms
107,952 KB
testcase_21 AC 538 ms
108,328 KB
testcase_22 AC 527 ms
107,548 KB
testcase_23 AC 528 ms
108,184 KB
testcase_24 AC 514 ms
104,292 KB
testcase_25 AC 512 ms
105,200 KB
testcase_26 AC 508 ms
102,472 KB
testcase_27 AC 505 ms
101,616 KB
testcase_28 AC 499 ms
100,176 KB
testcase_29 AC 487 ms
99,348 KB
testcase_30 AC 511 ms
99,668 KB
testcase_31 AC 490 ms
99,452 KB
testcase_32 AC 492 ms
99,312 KB
testcase_33 AC 539 ms
108,544 KB
testcase_34 AC 76 ms
71,312 KB
testcase_35 AC 74 ms
71,440 KB
testcase_36 AC 75 ms
71,216 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n, m = map(int, input().split())
lr = [list(map(int, input().split())) for i in range(m)]
lr.sort(key=lambda x:x[1])
last = lr[0][1]
cnt = 1
for i in range(1, m):
    l, r = lr[i]
    if last < l:
        cnt += 1
        last = r
print(n - cnt)
0