結果

問題 No.1557 Binary Variable
ユーザー prussian_coderprussian_coder
提出日時 2022-01-15 17:58:14
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 482 ms / 2,000 ms
コード長 217 bytes
コンパイル時間 290 ms
コンパイル使用メモリ 87,208 KB
実行使用メモリ 107,068 KB
最終ジャッジ日時 2023-08-14 02:50:27
合計ジャッジ時間 18,015 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 232 ms
95,948 KB
testcase_01 AC 222 ms
102,520 KB
testcase_02 AC 67 ms
71,076 KB
testcase_03 AC 58 ms
71,320 KB
testcase_04 AC 280 ms
97,000 KB
testcase_05 AC 280 ms
97,168 KB
testcase_06 AC 268 ms
97,384 KB
testcase_07 AC 271 ms
96,996 KB
testcase_08 AC 312 ms
97,128 KB
testcase_09 AC 337 ms
97,228 KB
testcase_10 AC 348 ms
97,088 KB
testcase_11 AC 347 ms
96,804 KB
testcase_12 AC 313 ms
97,068 KB
testcase_13 AC 352 ms
97,080 KB
testcase_14 AC 360 ms
97,068 KB
testcase_15 AC 359 ms
96,844 KB
testcase_16 AC 354 ms
97,052 KB
testcase_17 AC 353 ms
96,732 KB
testcase_18 AC 356 ms
96,944 KB
testcase_19 AC 391 ms
107,068 KB
testcase_20 AC 375 ms
97,380 KB
testcase_21 AC 364 ms
97,292 KB
testcase_22 AC 388 ms
106,928 KB
testcase_23 AC 398 ms
97,760 KB
testcase_24 AC 400 ms
104,516 KB
testcase_25 AC 405 ms
105,268 KB
testcase_26 AC 385 ms
102,644 KB
testcase_27 AC 390 ms
101,684 KB
testcase_28 AC 482 ms
100,160 KB
testcase_29 AC 379 ms
99,040 KB
testcase_30 AC 382 ms
99,328 KB
testcase_31 AC 384 ms
98,352 KB
testcase_32 AC 379 ms
99,312 KB
testcase_33 AC 364 ms
97,604 KB
testcase_34 AC 58 ms
71,212 KB
testcase_35 AC 57 ms
71,160 KB
testcase_36 AC 58 ms
71,568 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,K=map(int,input().split())
A=[[int(x) for x in input().split()] for _ in range(K)]
A=sorted(A, key=lambda x: x[1])
ans=0
p=0
for i in range(K):
    if A[i][0]>p:
        ans+=1
        p=A[i][1]
print(N-ans)        
0