結果

問題 No.1557 Binary Variable
ユーザー mesame3993mesame3993
提出日時 2021-10-01 14:58:35
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 521 ms / 2,000 ms
コード長 211 bytes
コンパイル時間 300 ms
コンパイル使用メモリ 86,800 KB
実行使用メモリ 108,316 KB
最終ジャッジ日時 2023-09-26 07:24:01
合計ジャッジ時間 18,642 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 265 ms
97,156 KB
testcase_01 AC 278 ms
102,124 KB
testcase_02 AC 72 ms
71,504 KB
testcase_03 AC 72 ms
71,328 KB
testcase_04 AC 367 ms
98,512 KB
testcase_05 AC 364 ms
98,424 KB
testcase_06 AC 330 ms
98,504 KB
testcase_07 AC 342 ms
98,632 KB
testcase_08 AC 402 ms
98,436 KB
testcase_09 AC 426 ms
98,460 KB
testcase_10 AC 444 ms
98,224 KB
testcase_11 AC 444 ms
98,256 KB
testcase_12 AC 405 ms
98,480 KB
testcase_13 AC 455 ms
98,172 KB
testcase_14 AC 473 ms
98,840 KB
testcase_15 AC 459 ms
98,092 KB
testcase_16 AC 465 ms
98,980 KB
testcase_17 AC 455 ms
99,048 KB
testcase_18 AC 457 ms
98,168 KB
testcase_19 AC 509 ms
107,184 KB
testcase_20 AC 513 ms
107,912 KB
testcase_21 AC 499 ms
108,044 KB
testcase_22 AC 489 ms
107,808 KB
testcase_23 AC 487 ms
108,004 KB
testcase_24 AC 502 ms
103,936 KB
testcase_25 AC 504 ms
104,980 KB
testcase_26 AC 505 ms
102,360 KB
testcase_27 AC 504 ms
101,404 KB
testcase_28 AC 488 ms
100,068 KB
testcase_29 AC 460 ms
99,248 KB
testcase_30 AC 505 ms
99,416 KB
testcase_31 AC 468 ms
99,164 KB
testcase_32 AC 478 ms
99,480 KB
testcase_33 AC 521 ms
108,316 KB
testcase_34 AC 71 ms
71,328 KB
testcase_35 AC 70 ms
71,440 KB
testcase_36 AC 68 ms
71,352 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, 0
for l,r in lr:
    if not l <= v <= r:
        v = r
        ans += 1
print(n-ans)
0