原文:North American Invitational Programming Contest 2018

A. Cut it Out 枚舉第一刀,那么之后每切一刀都會將原問題划分成兩個子問題。 考慮DP,設 f l r 表示 l 點順時針一直到 r 點還未切割的最小代價,預處理出每條邊的代價轉移即可。 時間復雜度 O n 。 include lt cstdio gt include lt cmath gt include lt algorithm gt using namespace std cons ...

2018-04-07 02:34 2 1615 推薦指數:

查看詳情

 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM