結果

問題 No.1557 Binary Variable
ユーザー convexineqconvexineq
提出日時 2021-07-19 07:06:09
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 523 ms / 2,000 ms
コード長 208 bytes
コンパイル時間 465 ms
コンパイル使用メモリ 86,460 KB
実行使用メモリ 108,268 KB
最終ジャッジ日時 2023-09-23 16:05:40
合計ジャッジ時間 20,680 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 270 ms
96,844 KB
testcase_01 AC 274 ms
102,156 KB
testcase_02 AC 72 ms
71,040 KB
testcase_03 AC 74 ms
71,108 KB
testcase_04 AC 357 ms
98,352 KB
testcase_05 AC 362 ms
98,364 KB
testcase_06 AC 351 ms
98,504 KB
testcase_07 AC 359 ms
98,684 KB
testcase_08 AC 413 ms
98,312 KB
testcase_09 AC 439 ms
98,252 KB
testcase_10 AC 459 ms
98,116 KB
testcase_11 AC 451 ms
98,108 KB
testcase_12 AC 403 ms
98,204 KB
testcase_13 AC 458 ms
98,048 KB
testcase_14 AC 477 ms
98,764 KB
testcase_15 AC 462 ms
98,128 KB
testcase_16 AC 475 ms
98,692 KB
testcase_17 AC 466 ms
98,080 KB
testcase_18 AC 461 ms
98,092 KB
testcase_19 AC 503 ms
106,996 KB
testcase_20 AC 516 ms
107,788 KB
testcase_21 AC 519 ms
108,028 KB
testcase_22 AC 509 ms
107,508 KB
testcase_23 AC 523 ms
108,136 KB
testcase_24 AC 500 ms
103,704 KB
testcase_25 AC 497 ms
105,148 KB
testcase_26 AC 488 ms
101,932 KB
testcase_27 AC 499 ms
101,372 KB
testcase_28 AC 491 ms
99,820 KB
testcase_29 AC 471 ms
99,160 KB
testcase_30 AC 488 ms
99,352 KB
testcase_31 AC 468 ms
99,024 KB
testcase_32 AC 466 ms
99,188 KB
testcase_33 AC 500 ms
108,268 KB
testcase_34 AC 73 ms
70,944 KB
testcase_35 AC 76 ms
71,160 KB
testcase_36 AC 77 ms
71,288 KB
権限があれば一括ダウンロードができます

ソースコード

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