結果

問題 No.1557 Binary Variable
ユーザー NatsubiSoganNatsubiSogan
提出日時 2021-06-25 22:24:58
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 821 ms / 2,000 ms
コード長 245 bytes
コンパイル時間 90 ms
コンパイル使用メモリ 10,624 KB
実行使用メモリ 50,308 KB
最終ジャッジ日時 2023-09-07 14:38:12
合計ジャッジ時間 25,894 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 587 ms
48,984 KB
testcase_01 AC 564 ms
45,664 KB
testcase_02 AC 13 ms
7,804 KB
testcase_03 AC 13 ms
8,012 KB
testcase_04 AC 659 ms
48,176 KB
testcase_05 AC 652 ms
47,872 KB
testcase_06 AC 643 ms
46,900 KB
testcase_07 AC 652 ms
47,600 KB
testcase_08 AC 694 ms
49,508 KB
testcase_09 AC 718 ms
49,592 KB
testcase_10 AC 714 ms
50,032 KB
testcase_11 AC 716 ms
50,084 KB
testcase_12 AC 691 ms
49,604 KB
testcase_13 AC 746 ms
49,936 KB
testcase_14 AC 800 ms
50,104 KB
testcase_15 AC 821 ms
50,144 KB
testcase_16 AC 746 ms
50,172 KB
testcase_17 AC 735 ms
50,104 KB
testcase_18 AC 732 ms
50,056 KB
testcase_19 AC 743 ms
50,112 KB
testcase_20 AC 757 ms
50,168 KB
testcase_21 AC 733 ms
50,160 KB
testcase_22 AC 741 ms
50,128 KB
testcase_23 AC 734 ms
50,036 KB
testcase_24 AC 743 ms
50,164 KB
testcase_25 AC 758 ms
50,108 KB
testcase_26 AC 736 ms
50,308 KB
testcase_27 AC 721 ms
50,064 KB
testcase_28 AC 731 ms
50,044 KB
testcase_29 AC 733 ms
50,168 KB
testcase_30 AC 733 ms
50,116 KB
testcase_31 AC 721 ms
50,056 KB
testcase_32 AC 753 ms
50,172 KB
testcase_33 AC 751 ms
50,012 KB
testcase_34 AC 14 ms
7,876 KB
testcase_35 AC 14 ms
7,844 KB
testcase_36 AC 13 ms
7,908 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