結果

問題 No.1557 Binary Variable
ユーザー 👑 KazunKazun
提出日時 2021-06-25 21:27:03
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 512 ms / 2,000 ms
コード長 245 bytes
コンパイル時間 755 ms
コンパイル使用メモリ 86,816 KB
実行使用メモリ 99,652 KB
最終ジャッジ日時 2023-09-07 14:02:44
合計ジャッジ時間 17,022 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 250 ms
89,032 KB
testcase_01 AC 278 ms
90,216 KB
testcase_02 AC 101 ms
71,520 KB
testcase_03 AC 99 ms
71,788 KB
testcase_04 AC 343 ms
89,440 KB
testcase_05 AC 340 ms
88,948 KB
testcase_06 AC 325 ms
89,292 KB
testcase_07 AC 332 ms
89,060 KB
testcase_08 AC 390 ms
89,292 KB
testcase_09 AC 408 ms
89,060 KB
testcase_10 AC 437 ms
89,104 KB
testcase_11 AC 434 ms
89,328 KB
testcase_12 AC 383 ms
89,444 KB
testcase_13 AC 434 ms
89,088 KB
testcase_14 AC 452 ms
89,172 KB
testcase_15 AC 439 ms
89,080 KB
testcase_16 AC 455 ms
89,048 KB
testcase_17 AC 449 ms
88,784 KB
testcase_18 AC 447 ms
89,100 KB
testcase_19 AC 459 ms
88,996 KB
testcase_20 AC 461 ms
88,716 KB
testcase_21 AC 462 ms
89,000 KB
testcase_22 AC 467 ms
88,852 KB
testcase_23 AC 457 ms
88,984 KB
testcase_24 AC 456 ms
90,168 KB
testcase_25 AC 455 ms
89,932 KB
testcase_26 AC 473 ms
90,648 KB
testcase_27 AC 475 ms
90,496 KB
testcase_28 AC 512 ms
99,652 KB
testcase_29 AC 500 ms
97,528 KB
testcase_30 AC 500 ms
98,304 KB
testcase_31 AC 498 ms
97,424 KB
testcase_32 AC 503 ms
98,228 KB
testcase_33 AC 459 ms
89,112 KB
testcase_34 AC 95 ms
71,516 KB
testcase_35 AC 93 ms
71,624 KB
testcase_36 AC 95 ms
71,356 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import defaultdict

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


I=[]
for _ in range(M):
    l,r=map(int,input().split())
    I.append((l,r))

I.sort(key=lambda x:x[1])
R=-1
X=0

for l,r in I:
    if R<l:
        X+=1
        R=r

print(N-X)
0