結果

問題 No.1557 Binary Variable
ユーザー ntudantuda
提出日時 2021-09-08 22:04:47
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 297 ms / 2,000 ms
コード長 302 bytes
コンパイル時間 531 ms
コンパイル使用メモリ 87,228 KB
実行使用メモリ 100,316 KB
最終ジャッジ日時 2023-08-27 07:28:36
合計ジャッジ時間 14,809 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 287 ms
98,988 KB
testcase_01 AC 292 ms
99,884 KB
testcase_02 AC 75 ms
71,304 KB
testcase_03 AC 74 ms
71,572 KB
testcase_04 AC 290 ms
99,920 KB
testcase_05 AC 290 ms
99,784 KB
testcase_06 AC 290 ms
100,256 KB
testcase_07 AC 284 ms
100,000 KB
testcase_08 AC 285 ms
100,028 KB
testcase_09 AC 293 ms
99,708 KB
testcase_10 AC 290 ms
99,904 KB
testcase_11 AC 291 ms
99,944 KB
testcase_12 AC 281 ms
99,904 KB
testcase_13 AC 296 ms
99,896 KB
testcase_14 AC 290 ms
100,188 KB
testcase_15 AC 292 ms
99,744 KB
testcase_16 AC 293 ms
100,076 KB
testcase_17 AC 297 ms
100,316 KB
testcase_18 AC 297 ms
100,224 KB
testcase_19 AC 287 ms
100,240 KB
testcase_20 AC 290 ms
100,092 KB
testcase_21 AC 289 ms
100,152 KB
testcase_22 AC 285 ms
99,888 KB
testcase_23 AC 282 ms
100,300 KB
testcase_24 AC 290 ms
99,700 KB
testcase_25 AC 283 ms
100,176 KB
testcase_26 AC 289 ms
99,660 KB
testcase_27 AC 283 ms
99,960 KB
testcase_28 AC 284 ms
99,956 KB
testcase_29 AC 294 ms
99,804 KB
testcase_30 AC 290 ms
99,876 KB
testcase_31 AC 291 ms
99,884 KB
testcase_32 AC 291 ms
99,956 KB
testcase_33 AC 289 ms
100,308 KB
testcase_34 AC 71 ms
70,980 KB
testcase_35 AC 73 ms
71,208 KB
testcase_36 AC 74 ms
71,204 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,M = map(int,input().split())
LR = [list(map(int,input().split())) for _ in range(M)]
LR.sort()
LR.append([10**9+1,10**9+2])
cnt = 0
lc = 0
rmin = 10**10
for l,r in LR:
    if lc < l:
        lc = l
        rmin = min(r,rmin)
        if l > rmin:
            cnt += 1
            rmin = r
print(N-cnt)
0