結果

問題 No.1557 Binary Variable
ユーザー c-yanc-yan
提出日時 2021-06-26 00:29:57
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 482 ms / 2,000 ms
コード長 286 bytes
コンパイル時間 1,212 ms
コンパイル使用メモリ 10,508 KB
実行使用メモリ 51,768 KB
最終ジャッジ日時 2023-09-07 15:12:57
合計ジャッジ時間 17,283 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 335 ms
50,476 KB
testcase_01 AC 333 ms
47,344 KB
testcase_02 AC 15 ms
7,784 KB
testcase_03 AC 15 ms
7,800 KB
testcase_04 AC 381 ms
49,548 KB
testcase_05 AC 384 ms
49,552 KB
testcase_06 AC 376 ms
48,440 KB
testcase_07 AC 383 ms
49,008 KB
testcase_08 AC 424 ms
51,192 KB
testcase_09 AC 421 ms
51,164 KB
testcase_10 AC 451 ms
51,496 KB
testcase_11 AC 445 ms
51,512 KB
testcase_12 AC 411 ms
51,136 KB
testcase_13 AC 457 ms
51,492 KB
testcase_14 AC 462 ms
51,632 KB
testcase_15 AC 454 ms
51,516 KB
testcase_16 AC 466 ms
51,620 KB
testcase_17 AC 464 ms
51,724 KB
testcase_18 AC 469 ms
51,556 KB
testcase_19 AC 458 ms
51,764 KB
testcase_20 AC 462 ms
51,628 KB
testcase_21 AC 468 ms
51,584 KB
testcase_22 AC 457 ms
51,748 KB
testcase_23 AC 454 ms
51,604 KB
testcase_24 AC 463 ms
51,696 KB
testcase_25 AC 463 ms
51,720 KB
testcase_26 AC 454 ms
51,636 KB
testcase_27 AC 453 ms
51,680 KB
testcase_28 AC 459 ms
51,584 KB
testcase_29 AC 452 ms
51,596 KB
testcase_30 AC 455 ms
51,564 KB
testcase_31 AC 465 ms
51,692 KB
testcase_32 AC 482 ms
51,660 KB
testcase_33 AC 468 ms
51,768 KB
testcase_34 AC 15 ms
7,892 KB
testcase_35 AC 15 ms
7,840 KB
testcase_36 AC 15 ms
7,888 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)]

result = N
t = -1
for L, R in sorted(LR, key=lambda x: x[1]):
    if L <= t <= R:
        continue
    result -= 1
    t = R
print(result)
0