結果

問題 No.1557 Binary Variable
ユーザー minimumminimum
提出日時 2021-06-25 21:31:33
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 551 ms / 2,000 ms
コード長 237 bytes
コンパイル時間 460 ms
コンパイル使用メモリ 87,004 KB
実行使用メモリ 108,432 KB
最終ジャッジ日時 2023-09-07 14:13:49
合計ジャッジ時間 19,227 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 323 ms
108,432 KB
testcase_01 AC 314 ms
106,192 KB
testcase_02 AC 74 ms
71,420 KB
testcase_03 AC 74 ms
71,236 KB
testcase_04 AC 418 ms
107,088 KB
testcase_05 AC 414 ms
107,080 KB
testcase_06 AC 411 ms
107,992 KB
testcase_07 AC 412 ms
107,156 KB
testcase_08 AC 458 ms
107,324 KB
testcase_09 AC 478 ms
107,604 KB
testcase_10 AC 507 ms
107,332 KB
testcase_11 AC 510 ms
107,284 KB
testcase_12 AC 457 ms
106,916 KB
testcase_13 AC 505 ms
107,268 KB
testcase_14 AC 545 ms
108,088 KB
testcase_15 AC 514 ms
107,140 KB
testcase_16 AC 551 ms
107,752 KB
testcase_17 AC 548 ms
107,344 KB
testcase_18 AC 534 ms
107,248 KB
testcase_19 AC 524 ms
107,464 KB
testcase_20 AC 531 ms
107,000 KB
testcase_21 AC 527 ms
107,284 KB
testcase_22 AC 519 ms
107,140 KB
testcase_23 AC 521 ms
107,384 KB
testcase_24 AC 533 ms
106,764 KB
testcase_25 AC 528 ms
106,972 KB
testcase_26 AC 525 ms
106,600 KB
testcase_27 AC 527 ms
106,596 KB
testcase_28 AC 527 ms
107,960 KB
testcase_29 AC 529 ms
108,064 KB
testcase_30 AC 524 ms
108,160 KB
testcase_31 AC 527 ms
108,076 KB
testcase_32 AC 528 ms
108,076 KB
testcase_33 AC 526 ms
107,396 KB
testcase_34 AC 73 ms
71,308 KB
testcase_35 AC 74 ms
71,280 KB
testcase_36 AC 74 ms
71,180 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n, m = map(int, input().split())
r = []
for i in range(m):
    r.append(list(map(int,input().split())))

r.sort()
r.sort(key = lambda x : x[1])

cnt = 0
z = -1
for x in r:
    if z < x[0]:
        cnt += 1
        z = x[1]
print(n - cnt)
0