結果

問題 No.1557 Binary Variable
ユーザー rlangevinrlangevin
提出日時 2023-01-09 16:27:26
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 178 ms / 2,000 ms
コード長 340 bytes
コンパイル時間 452 ms
コンパイル使用メモリ 86,664 KB
実行使用メモリ 88,132 KB
最終ジャッジ日時 2023-08-22 18:55:04
合計ジャッジ時間 10,284 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 168 ms
86,452 KB
testcase_01 AC 177 ms
87,696 KB
testcase_02 AC 73 ms
71,084 KB
testcase_03 AC 70 ms
71,076 KB
testcase_04 AC 168 ms
86,808 KB
testcase_05 AC 169 ms
86,692 KB
testcase_06 AC 166 ms
86,844 KB
testcase_07 AC 163 ms
86,872 KB
testcase_08 AC 164 ms
86,604 KB
testcase_09 AC 166 ms
86,676 KB
testcase_10 AC 166 ms
86,736 KB
testcase_11 AC 167 ms
86,768 KB
testcase_12 AC 167 ms
86,644 KB
testcase_13 AC 168 ms
86,560 KB
testcase_14 AC 169 ms
86,744 KB
testcase_15 AC 165 ms
86,740 KB
testcase_16 AC 170 ms
86,752 KB
testcase_17 AC 170 ms
86,732 KB
testcase_18 AC 170 ms
86,808 KB
testcase_19 AC 170 ms
86,688 KB
testcase_20 AC 169 ms
86,616 KB
testcase_21 AC 171 ms
86,664 KB
testcase_22 AC 168 ms
86,800 KB
testcase_23 AC 171 ms
86,660 KB
testcase_24 AC 176 ms
86,352 KB
testcase_25 AC 170 ms
86,580 KB
testcase_26 AC 172 ms
87,032 KB
testcase_27 AC 175 ms
86,980 KB
testcase_28 AC 173 ms
87,640 KB
testcase_29 AC 178 ms
88,132 KB
testcase_30 AC 176 ms
87,988 KB
testcase_31 AC 175 ms
87,932 KB
testcase_32 AC 175 ms
88,100 KB
testcase_33 AC 172 ms
86,656 KB
testcase_34 AC 71 ms
71,196 KB
testcase_35 AC 71 ms
71,392 KB
testcase_36 AC 70 ms
71,236 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
readline = sys.stdin.readline

N, M = map(int, readline().split())
D = []
for i in range(M):
    L, R = map(int, readline().split())
    D.append((L, R))
D.sort(reverse=True)

ans = N
pre = 10 ** 18
for i in range(M):
    L, R = D[i]
    if R >= pre:
        continue
    else:
        ans -= 1
        pre = L
print(ans)        
0