結果

問題 No.1557 Binary Variable
ユーザー tassei903tassei903
提出日時 2021-06-25 21:31:40
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 598 ms / 2,000 ms
コード長 548 bytes
コンパイル時間 301 ms
コンパイル使用メモリ 87,228 KB
実行使用メモリ 94,816 KB
最終ジャッジ日時 2023-09-07 14:14:20
合計ジャッジ時間 20,030 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 187 ms
93,496 KB
testcase_01 AC 196 ms
94,284 KB
testcase_02 AC 70 ms
71,524 KB
testcase_03 AC 69 ms
71,336 KB
testcase_04 AC 387 ms
94,348 KB
testcase_05 AC 379 ms
94,484 KB
testcase_06 AC 353 ms
94,468 KB
testcase_07 AC 377 ms
94,464 KB
testcase_08 AC 509 ms
94,336 KB
testcase_09 AC 544 ms
94,488 KB
testcase_10 AC 584 ms
94,496 KB
testcase_11 AC 598 ms
94,472 KB
testcase_12 AC 492 ms
94,488 KB
testcase_13 AC 588 ms
94,600 KB
testcase_14 AC 591 ms
94,220 KB
testcase_15 AC 580 ms
94,400 KB
testcase_16 AC 577 ms
93,916 KB
testcase_17 AC 580 ms
94,044 KB
testcase_18 AC 578 ms
94,032 KB
testcase_19 AC 581 ms
94,148 KB
testcase_20 AC 585 ms
94,072 KB
testcase_21 AC 591 ms
94,032 KB
testcase_22 AC 582 ms
93,920 KB
testcase_23 AC 577 ms
94,276 KB
testcase_24 AC 579 ms
93,624 KB
testcase_25 AC 586 ms
93,628 KB
testcase_26 AC 590 ms
93,480 KB
testcase_27 AC 589 ms
93,444 KB
testcase_28 AC 581 ms
94,556 KB
testcase_29 AC 586 ms
94,816 KB
testcase_30 AC 574 ms
94,564 KB
testcase_31 AC 582 ms
94,652 KB
testcase_32 AC 598 ms
94,556 KB
testcase_33 AC 578 ms
94,180 KB
testcase_34 AC 68 ms
71,084 KB
testcase_35 AC 69 ms
71,380 KB
testcase_36 AC 71 ms
71,520 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = lambda :sys.stdin.readline()[:-1]
ni = lambda :int(input())
na = lambda :list(map(int,input().split()))
sys.setrecursionlimit(10**7)
yes = lambda :print("yes");Yes = lambda :print("Yes")
no = lambda :print("no");No = lambda :print("No")
#######################################################################

n,m = na()

lr = []
for i in range(m):
    l,r = na()
    lr.append((r-1,l-1))

z = -1
lr = sorted(lr)
ans = 0
for i in range(m):
    #print(z,l,r)
    r,l = lr[i]
    if z<l:
        ans+=1
        z = r

print(n-ans)
0