結果

問題 No.1557 Binary Variable
ユーザー gorugo30gorugo30
提出日時 2021-06-25 21:33:03
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 523 ms / 2,000 ms
コード長 269 bytes
コンパイル時間 287 ms
コンパイル使用メモリ 86,900 KB
実行使用メモリ 108,672 KB
最終ジャッジ日時 2023-09-07 14:17:02
合計ジャッジ時間 16,910 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 260 ms
97,092 KB
testcase_01 AC 269 ms
102,516 KB
testcase_02 AC 66 ms
71,336 KB
testcase_03 AC 68 ms
71,392 KB
testcase_04 AC 348 ms
98,748 KB
testcase_05 AC 357 ms
98,660 KB
testcase_06 AC 334 ms
98,792 KB
testcase_07 AC 338 ms
98,776 KB
testcase_08 AC 404 ms
98,348 KB
testcase_09 AC 405 ms
98,644 KB
testcase_10 AC 448 ms
98,528 KB
testcase_11 AC 431 ms
98,568 KB
testcase_12 AC 391 ms
98,408 KB
testcase_13 AC 444 ms
98,320 KB
testcase_14 AC 449 ms
99,240 KB
testcase_15 AC 440 ms
98,500 KB
testcase_16 AC 449 ms
99,120 KB
testcase_17 AC 461 ms
99,140 KB
testcase_18 AC 450 ms
98,380 KB
testcase_19 AC 504 ms
107,164 KB
testcase_20 AC 499 ms
107,944 KB
testcase_21 AC 508 ms
108,144 KB
testcase_22 AC 518 ms
107,632 KB
testcase_23 AC 523 ms
108,308 KB
testcase_24 AC 511 ms
104,212 KB
testcase_25 AC 498 ms
105,020 KB
testcase_26 AC 479 ms
102,512 KB
testcase_27 AC 470 ms
101,708 KB
testcase_28 AC 474 ms
100,184 KB
testcase_29 AC 460 ms
99,420 KB
testcase_30 AC 479 ms
99,436 KB
testcase_31 AC 449 ms
99,424 KB
testcase_32 AC 454 ms
99,492 KB
testcase_33 AC 487 ms
108,672 KB
testcase_34 AC 68 ms
71,308 KB
testcase_35 AC 68 ms
71,244 KB
testcase_36 AC 72 ms
71,272 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N, M = map(int, input().split())

P = [list(map(int, input().split())) for i in range(M)]
P.sort(key = lambda x: x[1])

ans = N
last0 = 0
for i in range(M):
    l, r = P[i]
    if l <= last0 <= r:
        continue
    else:
        last0 = r
        ans -= 1
print(ans)
0