結果

問題 No.1557 Binary Variable
ユーザー kokonotsukokonotsu
提出日時 2021-07-19 16:35:34
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 285 bytes
コンパイル時間 1,149 ms
コンパイル使用メモリ 10,576 KB
実行使用メモリ 40,788 KB
最終ジャッジ日時 2023-09-24 12:33:25
合計ジャッジ時間 30,751 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 593 ms
36,160 KB
testcase_02 AC 14 ms
7,868 KB
testcase_03 AC 14 ms
7,836 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 734 ms
40,788 KB
testcase_15 WA -
testcase_16 AC 763 ms
40,664 KB
testcase_17 AC 750 ms
40,560 KB
testcase_18 AC 788 ms
40,704 KB
testcase_19 AC 778 ms
40,784 KB
testcase_20 AC 792 ms
40,688 KB
testcase_21 AC 769 ms
40,728 KB
testcase_22 AC 774 ms
40,756 KB
testcase_23 AC 750 ms
40,636 KB
testcase_24 AC 760 ms
40,672 KB
testcase_25 AC 748 ms
40,656 KB
testcase_26 AC 771 ms
40,632 KB
testcase_27 AC 787 ms
40,552 KB
testcase_28 AC 781 ms
40,728 KB
testcase_29 AC 788 ms
40,624 KB
testcase_30 AC 779 ms
40,736 KB
testcase_31 AC 762 ms
40,664 KB
testcase_32 AC 764 ms
40,672 KB
testcase_33 AC 771 ms
40,564 KB
testcase_34 AC 15 ms
7,928 KB
testcase_35 AC 14 ms
7,728 KB
testcase_36 AC 14 ms
7,864 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]+1
for i in range(1, M):
    if pre < data[i][0]:
        cnt += 1
        pre = data[i][1]+1

print(N-cnt)
0