#24567: lower_bound c++


wallacechu0409@gmail.com (Wallace Chu)

學校 : 國立臺灣師範大學附屬高級中學
編號 : 136430
來源 : [175.181.176.160]
最後登入時間 :
2025-03-05 13:42:33

先用struct 來sort ,再用lower bound 找出要插入vector的index,用vector.insert 插入切割點的座標在剛剛取的index於vector裡,之後用long long sum=sum+v[index+1]-v[index-1],最後輸出sum 即可。