結果

問題 No.1995 CHIKA Road
ユーザー 👑 H20H20
提出日時 2022-07-01 22:07:13
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 219 ms / 2,000 ms
コード長 209 bytes
コンパイル時間 229 ms
コンパイル使用メモリ 82,028 KB
実行使用メモリ 91,860 KB
最終ジャッジ日時 2024-05-04 16:30:59
合計ジャッジ時間 6,177 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 34 ms
52,472 KB
testcase_01 AC 35 ms
52,064 KB
testcase_02 AC 35 ms
52,588 KB
testcase_03 AC 31 ms
52,952 KB
testcase_04 AC 32 ms
53,688 KB
testcase_05 AC 38 ms
53,820 KB
testcase_06 AC 70 ms
77,448 KB
testcase_07 AC 97 ms
78,960 KB
testcase_08 AC 35 ms
53,728 KB
testcase_09 AC 36 ms
53,956 KB
testcase_10 AC 194 ms
88,720 KB
testcase_11 AC 207 ms
87,760 KB
testcase_12 AC 130 ms
87,024 KB
testcase_13 AC 114 ms
79,076 KB
testcase_14 AC 115 ms
79,296 KB
testcase_15 AC 199 ms
85,692 KB
testcase_16 AC 76 ms
77,100 KB
testcase_17 AC 151 ms
84,316 KB
testcase_18 AC 209 ms
88,116 KB
testcase_19 AC 219 ms
87,896 KB
testcase_20 AC 153 ms
81,652 KB
testcase_21 AC 146 ms
81,440 KB
testcase_22 AC 209 ms
91,860 KB
testcase_23 AC 102 ms
79,224 KB
testcase_24 AC 179 ms
85,908 KB
testcase_25 AC 87 ms
77,360 KB
testcase_26 AC 113 ms
79,312 KB
testcase_27 AC 183 ms
86,248 KB
testcase_28 AC 131 ms
81,680 KB
testcase_29 AC 218 ms
89,088 KB
testcase_30 AC 78 ms
77,000 KB
testcase_31 AC 69 ms
76,932 KB
testcase_32 AC 87 ms
77,112 KB
testcase_33 AC 185 ms
88,328 KB
testcase_34 AC 70 ms
76,864 KB
testcase_35 AC 101 ms
79,452 KB
testcase_36 AC 113 ms
79,652 KB
testcase_37 AC 199 ms
86,208 KB
testcase_38 AC 153 ms
83,796 KB
testcase_39 AC 74 ms
76,964 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,M = map(int, input().split())
AB = [list(map(int, input().split())) for _ in range(M)]
AB = sorted(AB, key=lambda x: x[1])
v = 0
ans = 2*N-2
for a,b in AB:
    if v<=a:
        ans-=1
        v=b
print(ans)
0