結果

問題 No.1557 Binary Variable
ユーザー KudeKude
提出日時 2021-06-25 21:25:58
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 581 ms / 2,000 ms
コード長 229 bytes
コンパイル時間 308 ms
コンパイル使用メモリ 87,200 KB
実行使用メモリ 104,832 KB
最終ジャッジ日時 2023-09-07 14:02:07
合計ジャッジ時間 19,653 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 305 ms
103,752 KB
testcase_01 AC 306 ms
103,372 KB
testcase_02 AC 75 ms
71,348 KB
testcase_03 AC 75 ms
71,340 KB
testcase_04 AC 418 ms
104,652 KB
testcase_05 AC 411 ms
104,696 KB
testcase_06 AC 391 ms
104,832 KB
testcase_07 AC 400 ms
104,564 KB
testcase_08 AC 475 ms
104,604 KB
testcase_09 AC 500 ms
104,696 KB
testcase_10 AC 537 ms
104,364 KB
testcase_11 AC 548 ms
104,496 KB
testcase_12 AC 487 ms
104,652 KB
testcase_13 AC 559 ms
104,500 KB
testcase_14 AC 568 ms
104,204 KB
testcase_15 AC 539 ms
104,552 KB
testcase_16 AC 540 ms
104,504 KB
testcase_17 AC 553 ms
104,492 KB
testcase_18 AC 563 ms
104,040 KB
testcase_19 AC 567 ms
104,436 KB
testcase_20 AC 570 ms
104,240 KB
testcase_21 AC 566 ms
104,384 KB
testcase_22 AC 560 ms
104,140 KB
testcase_23 AC 561 ms
103,912 KB
testcase_24 AC 572 ms
104,048 KB
testcase_25 AC 555 ms
104,164 KB
testcase_26 AC 560 ms
103,940 KB
testcase_27 AC 562 ms
103,916 KB
testcase_28 AC 559 ms
103,772 KB
testcase_29 AC 572 ms
104,596 KB
testcase_30 AC 569 ms
103,640 KB
testcase_31 AC 581 ms
104,696 KB
testcase_32 AC 574 ms
103,680 KB
testcase_33 AC 547 ms
104,508 KB
testcase_34 AC 73 ms
71,328 KB
testcase_35 AC 74 ms
71,184 KB
testcase_36 AC 74 ms
71,544 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n, m = map(int, input().split())
rightmost = -1
ans = n
lr = sorted((tuple(map(int, input().split())) for _ in range(m)), key=lambda x: x[1])
for l, r in lr:
    if l > rightmost:
        ans -= 1
        rightmost = r
print(ans)
0