結果

問題 No.1557 Binary Variable
ユーザー RustyRusty
提出日時 2023-01-04 12:53:19
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 296 bytes
コンパイル時間 84 ms
コンパイル使用メモリ 10,612 KB
実行使用メモリ 38,680 KB
最終ジャッジ日時 2023-08-18 10:58:06
合計ジャッジ時間 34,499 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 628 ms
38,000 KB
testcase_01 AC 612 ms
35,004 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 AC 780 ms
36,584 KB
testcase_05 WA -
testcase_06 AC 772 ms
35,408 KB
testcase_07 AC 777 ms
35,984 KB
testcase_08 AC 870 ms
37,960 KB
testcase_09 AC 896 ms
38,224 KB
testcase_10 AC 948 ms
38,436 KB
testcase_11 WA -
testcase_12 AC 856 ms
37,916 KB
testcase_13 AC 967 ms
38,556 KB
testcase_14 AC 976 ms
38,496 KB
testcase_15 WA -
testcase_16 AC 977 ms
38,648 KB
testcase_17 AC 1,025 ms
38,584 KB
testcase_18 AC 1,021 ms
38,676 KB
testcase_19 WA -
testcase_20 WA -
testcase_21 AC 993 ms
38,532 KB
testcase_22 WA -
testcase_23 WA -
testcase_24 AC 1,016 ms
38,544 KB
testcase_25 AC 985 ms
38,560 KB
testcase_26 WA -
testcase_27 WA -
testcase_28 AC 977 ms
38,592 KB
testcase_29 AC 976 ms
38,576 KB
testcase_30 AC 985 ms
38,572 KB
testcase_31 AC 994 ms
38,580 KB
testcase_32 AC 988 ms
38,680 KB
testcase_33 AC 970 ms
38,576 KB
testcase_34 AC 13 ms
7,796 KB
testcase_35 AC 13 ms
7,844 KB
testcase_36 AC 13 ms
7,904 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n,m = map(int,input().split())
L = []
for i in range(m):
    l,r = map(int,input().split())
    L.append([r,l])
L.sort()
ans = n
r = 0
for i in range(m):
    if i <= r:
        continue
    while L[r+1][1] <= L[i][0]:
        r += 1
        if r == m-1:
            break
    ans -= 1

print(ans)
0