結果

問題 No.1557 Binary Variable
ユーザー playerplayer
提出日時 2023-12-20 16:50:10
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 763 ms / 2,000 ms
コード長 417 bytes
コンパイル時間 254 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 100,368 KB
最終ジャッジ日時 2023-12-20 16:50:36
合計ジャッジ時間 25,921 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 281 ms
98,572 KB
testcase_01 AC 247 ms
99,964 KB
testcase_02 AC 35 ms
53,460 KB
testcase_03 AC 35 ms
53,460 KB
testcase_04 AC 482 ms
99,676 KB
testcase_05 AC 487 ms
99,692 KB
testcase_06 AC 441 ms
99,668 KB
testcase_07 AC 445 ms
99,740 KB
testcase_08 AC 625 ms
99,656 KB
testcase_09 AC 636 ms
99,388 KB
testcase_10 AC 732 ms
99,288 KB
testcase_11 AC 730 ms
99,412 KB
testcase_12 AC 581 ms
99,656 KB
testcase_13 AC 728 ms
99,408 KB
testcase_14 AC 699 ms
99,664 KB
testcase_15 AC 713 ms
99,404 KB
testcase_16 AC 744 ms
99,656 KB
testcase_17 AC 717 ms
99,304 KB
testcase_18 AC 738 ms
99,320 KB
testcase_19 AC 714 ms
99,372 KB
testcase_20 AC 744 ms
99,428 KB
testcase_21 AC 747 ms
99,436 KB
testcase_22 AC 703 ms
99,388 KB
testcase_23 AC 727 ms
99,496 KB
testcase_24 AC 748 ms
99,372 KB
testcase_25 AC 762 ms
99,336 KB
testcase_26 AC 758 ms
99,076 KB
testcase_27 AC 727 ms
99,140 KB
testcase_28 AC 728 ms
98,900 KB
testcase_29 AC 763 ms
100,328 KB
testcase_30 AC 735 ms
100,368 KB
testcase_31 AC 746 ms
100,320 KB
testcase_32 AC 732 ms
100,368 KB
testcase_33 AC 748 ms
99,532 KB
testcase_34 AC 35 ms
53,460 KB
testcase_35 AC 35 ms
53,460 KB
testcase_36 AC 36 ms
53,460 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

# 全てのli,riの区間において0が含まれている
# 区間スケジューリング

n,m = map(int,input().split())

lis = []
for i in range(m):
    l,r = map(int,input().split())
    lis.append([r,l])
    
lis.sort()
cnt = 0
for i in range(m):
    r,l = lis[i]
    if i == 0:
        cnt += 1
        lastr = r
    else:
        if l > lastr:
            cnt += 1
            lastr = r
        
print(n-cnt)
0