結果

問題 No.1557 Binary Variable
ユーザー convexineq
提出日時 2021-07-19 07:06:09
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 435 ms / 2,000 ms
コード長 208 bytes
コンパイル時間 213 ms
コンパイル使用メモリ 82,468 KB
実行使用メモリ 107,604 KB
最終ジャッジ日時 2024-07-16 15:51:52
合計ジャッジ時間 15,917 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 34
権限があれば一括ダウンロードができます

ソースコード

diff #

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