結果

問題 No.1557 Binary Variable
ユーザー Navier_Boltzmann
提出日時 2021-06-26 18:47:46
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 234 bytes
コンパイル時間 164 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 41,396 KB
最終ジャッジ日時 2024-06-25 09:16:18
合計ジャッジ時間 41,325 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2 WA * 1
other AC * 1 WA * 33
権限があれば一括ダウンロードができます

ソースコード

diff #

N,M = map(int,input().split())
R = [[]]*M
for i in range(M):
  l,r = map(int,input().split())
  R[i] = [r,l]
  
R.sort()
ans=0
con_l=0
for i in range(M):
    if con_l <= R[i][1]:
        ans += 1
        con_l = R[i][0]
print(N-ans+1)
0