結果

問題 No.1995 CHIKA Road
ユーザー nohakai3nohakai3
提出日時 2022-07-25 16:07:23
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 419 ms / 2,000 ms
コード長 235 bytes
コンパイル時間 624 ms
コンパイル使用メモリ 10,536 KB
実行使用メモリ 29,232 KB
最終ジャッジ日時 2023-09-21 22:06:45
合計ジャッジ時間 11,684 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 17 ms
7,848 KB
testcase_01 AC 16 ms
7,772 KB
testcase_02 AC 17 ms
7,848 KB
testcase_03 AC 18 ms
7,844 KB
testcase_04 AC 17 ms
7,832 KB
testcase_05 AC 17 ms
7,792 KB
testcase_06 AC 44 ms
9,800 KB
testcase_07 AC 112 ms
13,604 KB
testcase_08 AC 17 ms
7,924 KB
testcase_09 AC 17 ms
7,820 KB
testcase_10 AC 374 ms
25,544 KB
testcase_11 AC 394 ms
29,232 KB
testcase_12 AC 324 ms
28,728 KB
testcase_13 AC 130 ms
15,176 KB
testcase_14 AC 136 ms
15,396 KB
testcase_15 AC 353 ms
26,640 KB
testcase_16 AC 62 ms
10,860 KB
testcase_17 AC 239 ms
19,944 KB
testcase_18 AC 419 ms
27,660 KB
testcase_19 AC 406 ms
27,664 KB
testcase_20 AC 209 ms
18,632 KB
testcase_21 AC 191 ms
17,688 KB
testcase_22 AC 381 ms
26,660 KB
testcase_23 AC 114 ms
13,944 KB
testcase_24 AC 318 ms
24,504 KB
testcase_25 AC 75 ms
11,600 KB
testcase_26 AC 132 ms
14,728 KB
testcase_27 AC 305 ms
23,820 KB
testcase_28 AC 188 ms
17,856 KB
testcase_29 AC 391 ms
27,124 KB
testcase_30 AC 69 ms
11,280 KB
testcase_31 AC 40 ms
9,648 KB
testcase_32 AC 87 ms
12,204 KB
testcase_33 AC 301 ms
23,360 KB
testcase_34 AC 44 ms
9,748 KB
testcase_35 AC 128 ms
14,304 KB
testcase_36 AC 146 ms
15,332 KB
testcase_37 AC 377 ms
26,456 KB
testcase_38 AC 246 ms
20,656 KB
testcase_39 AC 40 ms
9,656 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n,m=map(int,input().split())
from operator import itemgetter
p=[list(map(int,input().split())) for i in [0]*m]
p.sort(key=itemgetter(1))

now=0
ans=2*(n-1)
for l,r in p:
    if (now>l):
        continue
    now=r
    ans-=1

print(ans)
0