結果

問題 No.1557 Binary Variable
ユーザー RustyRusty
提出日時 2023-01-04 12:53:19
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 296 bytes
コンパイル時間 199 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 41,424 KB
最終ジャッジ日時 2024-11-27 15:17:15
合計ジャッジ時間 42,047 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 23 WA * 11
権限があれば一括ダウンロードができます

ソースコード

diff #

n,m = map(int,input().split())
L = []
for i in range(m):
    l,r = map(int,input().split())
    L.append([r,l])
L.sort()
ans = n
r = 0
for i in range(m):
    if i <= r:
        continue
    while L[r+1][1] <= L[i][0]:
        r += 1
        if r == m-1:
            break
    ans -= 1

print(ans)
0