結果

問題 No.1557 Binary Variable
ユーザー lloyzlloyz
提出日時 2022-01-02 21:14:01
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 1,191 ms / 2,000 ms
コード長 272 bytes
コンパイル時間 85 ms
コンパイル使用メモリ 12,800 KB
実行使用メモリ 65,536 KB
最終ジャッジ日時 2024-04-20 06:17:58
合計ジャッジ時間 35,461 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 731 ms
64,128 KB
testcase_01 AC 727 ms
61,056 KB
testcase_02 AC 25 ms
10,752 KB
testcase_03 AC 25 ms
10,752 KB
testcase_04 AC 915 ms
63,316 KB
testcase_05 AC 887 ms
63,304 KB
testcase_06 AC 883 ms
62,188 KB
testcase_07 AC 902 ms
62,868 KB
testcase_08 AC 989 ms
64,784 KB
testcase_09 AC 971 ms
65,052 KB
testcase_10 AC 996 ms
65,252 KB
testcase_11 AC 1,045 ms
65,260 KB
testcase_12 AC 965 ms
64,732 KB
testcase_13 AC 1,002 ms
65,400 KB
testcase_14 AC 942 ms
65,408 KB
testcase_15 AC 1,015 ms
65,408 KB
testcase_16 AC 1,014 ms
65,340 KB
testcase_17 AC 979 ms
65,336 KB
testcase_18 AC 976 ms
65,456 KB
testcase_19 AC 1,038 ms
65,528 KB
testcase_20 AC 1,003 ms
65,476 KB
testcase_21 AC 998 ms
65,472 KB
testcase_22 AC 1,016 ms
65,536 KB
testcase_23 AC 1,013 ms
65,472 KB
testcase_24 AC 978 ms
65,344 KB
testcase_25 AC 1,013 ms
65,408 KB
testcase_26 AC 1,052 ms
65,408 KB
testcase_27 AC 1,191 ms
65,468 KB
testcase_28 AC 1,006 ms
65,348 KB
testcase_29 AC 1,037 ms
65,472 KB
testcase_30 AC 1,045 ms
65,468 KB
testcase_31 AC 1,015 ms
65,476 KB
testcase_32 AC 1,049 ms
65,480 KB
testcase_33 AC 1,012 ms
65,348 KB
testcase_34 AC 25 ms
10,752 KB
testcase_35 AC 26 ms
10,752 KB
testcase_36 AC 26 ms
10,752 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n, m = map(int, input().split())
LR = [list(map(int, input().split())) for _ in range(m)]

LR.sort(key=lambda x: (x[1], x[0]))
I = [LR[0][1]]
for i in range(1, m):
    if LR[i][0] <= I[-1] <= LR[i][1]:
        continue
    I.append(LR[i][1])

print(n - len(I))
0