結果

問題 No.1557 Binary Variable
コンテスト
ユーザー U S
提出日時 2021-06-25 21:53:10
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 289 ms / 2,000 ms
コード長 552 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 116 ms
コンパイル使用メモリ 85,244 KB
実行使用メモリ 102,312 KB
最終ジャッジ日時 2026-03-11 17:13:14
合計ジャッジ時間 10,273 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge1_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 34
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

# import sys
# input = sys.stdin.readline
def mp():return map(int,input().split())
def lmp():return list(map(int,input().split()))
import math
import bisect
from copy import deepcopy as dc
from itertools import accumulate
from collections import Counter, defaultdict, deque
def ceil(U,V):return (U+V-1)//V
def modf1(N,MOD):return (N-1)%MOD+1
inf = int(1e30)
mod = int(1e9+7)

n,m = mp()
h = []
for i in range(m):
    a,b = mp()
    h.append((a,b))
h.sort(key=lambda x:x[1])
bot = 0
for i,j in h:
    if bot < i:
        n -= 1
        bot = j
print(n)
0