結果

問題 No.1557 Binary Variable
ユーザー kohei2019kohei2019
提出日時 2022-06-19 13:52:37
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 381 ms / 2,000 ms
コード長 368 bytes
コンパイル時間 339 ms
コンパイル使用メモリ 82,344 KB
実行使用メモリ 98,196 KB
最終ジャッジ日時 2024-04-19 19:05:11
合計ジャッジ時間 13,081 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 179 ms
88,972 KB
testcase_01 AC 190 ms
89,228 KB
testcase_02 AC 32 ms
51,712 KB
testcase_03 AC 32 ms
51,584 KB
testcase_04 AC 247 ms
90,180 KB
testcase_05 AC 244 ms
90,040 KB
testcase_06 AC 234 ms
89,024 KB
testcase_07 AC 237 ms
89,004 KB
testcase_08 AC 285 ms
90,516 KB
testcase_09 AC 302 ms
89,748 KB
testcase_10 AC 324 ms
90,100 KB
testcase_11 AC 328 ms
89,828 KB
testcase_12 AC 300 ms
89,876 KB
testcase_13 AC 324 ms
90,084 KB
testcase_14 AC 350 ms
89,100 KB
testcase_15 AC 336 ms
90,328 KB
testcase_16 AC 351 ms
88,720 KB
testcase_17 AC 341 ms
89,104 KB
testcase_18 AC 339 ms
88,972 KB
testcase_19 AC 364 ms
97,168 KB
testcase_20 AC 374 ms
98,192 KB
testcase_21 AC 381 ms
98,004 KB
testcase_22 AC 375 ms
97,680 KB
testcase_23 AC 372 ms
98,064 KB
testcase_24 AC 360 ms
94,192 KB
testcase_25 AC 366 ms
95,232 KB
testcase_26 AC 364 ms
92,084 KB
testcase_27 AC 368 ms
91,940 KB
testcase_28 AC 373 ms
90,232 KB
testcase_29 AC 353 ms
90,192 KB
testcase_30 AC 368 ms
90,212 KB
testcase_31 AC 350 ms
90,712 KB
testcase_32 AC 345 ms
90,404 KB
testcase_33 AC 374 ms
98,196 KB
testcase_34 AC 35 ms
52,096 KB
testcase_35 AC 33 ms
51,712 KB
testcase_36 AC 33 ms
51,712 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,M = map(int,input().split())
lsLR = []
for i in range(M):
    L,R = map(int,input().split())
    lsLR.append((L,R))
lsLR.sort(key=lambda x:-x[1])
cnt = 0
ind = 0
while lsLR:
    l,r = lsLR.pop()
    rr = r
    cnt += 1
    while lsLR:
        l,r = lsLR[-1]
        if l <= rr:
            lsLR.pop()
            continue
        else:
            break
print(N-cnt)
0