結果

問題 No.1557 Binary Variable
ユーザー SidewaysOwlSidewaysOwl
提出日時 2021-10-20 17:51:33
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 857 ms / 2,000 ms
コード長 244 bytes
コンパイル時間 1,603 ms
コンパイル使用メモリ 81,448 KB
実行使用メモリ 117,216 KB
最終ジャッジ日時 2023-10-20 11:05:58
合計ジャッジ時間 27,261 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 288 ms
114,892 KB
testcase_01 AC 292 ms
114,288 KB
testcase_02 AC 38 ms
53,284 KB
testcase_03 AC 38 ms
53,284 KB
testcase_04 AC 564 ms
116,212 KB
testcase_05 AC 557 ms
116,224 KB
testcase_06 AC 517 ms
116,248 KB
testcase_07 AC 531 ms
116,256 KB
testcase_08 AC 700 ms
116,308 KB
testcase_09 AC 749 ms
116,280 KB
testcase_10 AC 836 ms
116,276 KB
testcase_11 AC 843 ms
116,272 KB
testcase_12 AC 693 ms
116,316 KB
testcase_13 AC 847 ms
116,280 KB
testcase_14 AC 844 ms
116,192 KB
testcase_15 AC 844 ms
116,268 KB
testcase_16 AC 846 ms
116,096 KB
testcase_17 AC 848 ms
116,124 KB
testcase_18 AC 857 ms
116,132 KB
testcase_19 AC 854 ms
115,784 KB
testcase_20 AC 848 ms
115,784 KB
testcase_21 AC 849 ms
115,800 KB
testcase_22 AC 847 ms
115,824 KB
testcase_23 AC 829 ms
115,812 KB
testcase_24 AC 833 ms
115,568 KB
testcase_25 AC 836 ms
115,516 KB
testcase_26 AC 832 ms
115,912 KB
testcase_27 AC 845 ms
115,932 KB
testcase_28 AC 843 ms
115,996 KB
testcase_29 AC 842 ms
117,164 KB
testcase_30 AC 849 ms
116,056 KB
testcase_31 AC 850 ms
117,216 KB
testcase_32 AC 848 ms
116,060 KB
testcase_33 AC 841 ms
115,856 KB
testcase_34 AC 38 ms
53,284 KB
testcase_35 AC 38 ms
53,284 KB
testcase_36 AC 38 ms
53,284 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n,m = map(int,input().split())
lr = []
for _ in range(m):
    lr.append(list(map(int,input().split())))
lr.sort(key = lambda x:(x[1],x[0]))
ans = n
R = 0
for i in range(m):
    l,r = lr[i]
    if l > R:
        ans -= 1
        R = r
print(ans)
0