結果

問題 No.1557 Binary Variable
ユーザー hir355hir355
提出日時 2021-06-25 21:27:45
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 550 ms / 2,000 ms
コード長 204 bytes
コンパイル時間 434 ms
コンパイル使用メモリ 86,960 KB
実行使用メモリ 108,284 KB
最終ジャッジ日時 2023-09-07 14:06:25
合計ジャッジ時間 18,567 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 278 ms
97,068 KB
testcase_01 AC 293 ms
102,008 KB
testcase_02 AC 77 ms
71,360 KB
testcase_03 AC 78 ms
71,428 KB
testcase_04 AC 377 ms
98,524 KB
testcase_05 AC 378 ms
98,744 KB
testcase_06 AC 366 ms
98,608 KB
testcase_07 AC 371 ms
98,560 KB
testcase_08 AC 429 ms
98,412 KB
testcase_09 AC 451 ms
98,268 KB
testcase_10 AC 489 ms
98,560 KB
testcase_11 AC 489 ms
98,420 KB
testcase_12 AC 438 ms
98,440 KB
testcase_13 AC 482 ms
98,248 KB
testcase_14 AC 501 ms
98,976 KB
testcase_15 AC 478 ms
98,436 KB
testcase_16 AC 510 ms
99,232 KB
testcase_17 AC 499 ms
98,316 KB
testcase_18 AC 490 ms
98,204 KB
testcase_19 AC 535 ms
107,092 KB
testcase_20 AC 544 ms
108,076 KB
testcase_21 AC 531 ms
108,092 KB
testcase_22 AC 548 ms
107,668 KB
testcase_23 AC 550 ms
108,212 KB
testcase_24 AC 533 ms
103,940 KB
testcase_25 AC 542 ms
104,984 KB
testcase_26 AC 524 ms
102,284 KB
testcase_27 AC 524 ms
101,504 KB
testcase_28 AC 525 ms
100,184 KB
testcase_29 AC 496 ms
99,164 KB
testcase_30 AC 515 ms
99,744 KB
testcase_31 AC 495 ms
99,296 KB
testcase_32 AC 491 ms
99,500 KB
testcase_33 AC 544 ms
108,284 KB
testcase_34 AC 76 ms
71,220 KB
testcase_35 AC 76 ms
71,428 KB
testcase_36 AC 76 ms
71,428 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n, m = map(int, input().split())
l = [list(map(int, input().split())) for _ in range(m)]
l.sort(key=lambda x:x[1])
t = 0
ans = n
for x, y in l:
    if t <= x:
        t = y + 1
        ans -= 1
print(ans)
0