結果

問題 No.1995 CHIKA Road
ユーザー Keroru
提出日時 2022-07-01 22:00:39
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 203 ms / 2,000 ms
コード長 153 bytes
コンパイル時間 462 ms
コンパイル使用メモリ 81,840 KB
実行使用メモリ 122,820 KB
最終ジャッジ日時 2024-11-26 05:02:53
合計ジャッジ時間 6,178 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 37
権限があれば一括ダウンロードができます

ソースコード

diff #

n,m,*z=map(int,open(0).read().split())
r=0
d=2*n-2
for a,b in sorted([(a,b)for a,b in zip(z[::2],z[1::2])],key=lambda x:x[1]):
 if a>=r:r=b;d-=1
print(d)
0