結果

問題 No.1557 Binary Variable
ユーザー c-yanc-yan
提出日時 2021-06-25 21:38:24
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 566 ms / 2,000 ms
コード長 307 bytes
コンパイル時間 399 ms
コンパイル使用メモリ 10,556 KB
実行使用メモリ 50,228 KB
最終ジャッジ日時 2023-09-07 14:19:07
合計ジャッジ時間 19,571 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 358 ms
48,860 KB
testcase_01 AC 349 ms
45,780 KB
testcase_02 AC 16 ms
7,788 KB
testcase_03 AC 16 ms
7,876 KB
testcase_04 AC 452 ms
48,144 KB
testcase_05 AC 447 ms
48,004 KB
testcase_06 AC 433 ms
46,952 KB
testcase_07 AC 439 ms
47,620 KB
testcase_08 AC 511 ms
49,484 KB
testcase_09 AC 522 ms
49,608 KB
testcase_10 AC 563 ms
50,020 KB
testcase_11 AC 566 ms
50,080 KB
testcase_12 AC 489 ms
49,496 KB
testcase_13 AC 553 ms
50,136 KB
testcase_14 AC 564 ms
50,172 KB
testcase_15 AC 555 ms
49,996 KB
testcase_16 AC 561 ms
50,168 KB
testcase_17 AC 550 ms
50,036 KB
testcase_18 AC 554 ms
50,200 KB
testcase_19 AC 539 ms
50,228 KB
testcase_20 AC 550 ms
50,064 KB
testcase_21 AC 551 ms
50,060 KB
testcase_22 AC 547 ms
50,120 KB
testcase_23 AC 560 ms
50,028 KB
testcase_24 AC 544 ms
50,164 KB
testcase_25 AC 540 ms
50,220 KB
testcase_26 AC 532 ms
50,164 KB
testcase_27 AC 546 ms
50,228 KB
testcase_28 AC 528 ms
50,076 KB
testcase_29 AC 530 ms
50,120 KB
testcase_30 AC 538 ms
50,092 KB
testcase_31 AC 532 ms
50,060 KB
testcase_32 AC 539 ms
50,212 KB
testcase_33 AC 558 ms
50,040 KB
testcase_34 AC 16 ms
7,808 KB
testcase_35 AC 16 ms
7,908 KB
testcase_36 AC 16 ms
7,932 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from sys import stdin

readline = stdin.readline

N, M = map(int, readline().split())
LR = [list(map(int, readline().split())) for _ in range(M)]

LR.sort(key=lambda x: x[1])

result = N
t = -1
for i in range(M):
    L, R = LR[i]
    if L <= t <= R:
        continue
    result -= 1
    t = R
print(result)
0