結果

問題 No.1557 Binary Variable
ユーザー kokonotsukokonotsu
提出日時 2021-07-19 16:42:05
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 802 ms / 2,000 ms
コード長 280 bytes
コンパイル時間 205 ms
コンパイル使用メモリ 10,728 KB
実行使用メモリ 40,788 KB
最終ジャッジ日時 2023-09-24 12:36:39
合計ジャッジ時間 26,574 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 584 ms
39,468 KB
testcase_01 AC 597 ms
36,240 KB
testcase_02 AC 14 ms
7,780 KB
testcase_03 AC 15 ms
7,808 KB
testcase_04 AC 656 ms
38,580 KB
testcase_05 AC 649 ms
38,592 KB
testcase_06 AC 651 ms
37,504 KB
testcase_07 AC 682 ms
38,048 KB
testcase_08 AC 701 ms
40,100 KB
testcase_09 AC 726 ms
40,212 KB
testcase_10 AC 784 ms
40,612 KB
testcase_11 AC 748 ms
40,620 KB
testcase_12 AC 703 ms
40,068 KB
testcase_13 AC 746 ms
40,544 KB
testcase_14 AC 764 ms
40,700 KB
testcase_15 AC 745 ms
40,624 KB
testcase_16 AC 756 ms
40,700 KB
testcase_17 AC 758 ms
40,632 KB
testcase_18 AC 766 ms
40,748 KB
testcase_19 AC 779 ms
40,752 KB
testcase_20 AC 767 ms
40,788 KB
testcase_21 AC 758 ms
40,740 KB
testcase_22 AC 732 ms
40,752 KB
testcase_23 AC 764 ms
40,748 KB
testcase_24 AC 763 ms
40,764 KB
testcase_25 AC 775 ms
40,684 KB
testcase_26 AC 757 ms
40,712 KB
testcase_27 AC 769 ms
40,624 KB
testcase_28 AC 785 ms
40,704 KB
testcase_29 AC 802 ms
40,624 KB
testcase_30 AC 781 ms
40,748 KB
testcase_31 AC 757 ms
40,676 KB
testcase_32 AC 755 ms
40,648 KB
testcase_33 AC 738 ms
40,624 KB
testcase_34 AC 14 ms
7,776 KB
testcase_35 AC 14 ms
7,788 KB
testcase_36 AC 15 ms
7,968 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

data.sort(key=lambda x:x[1])

cnt = 1
pre = data[0][1]
for i in range(1, M):
    if pre < data[i][0]:
        cnt += 1
        pre = data[i][1]

print(N-cnt)
0