原文: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