跳到正文

算法·理论

ABC248 Note

MatrixGroup约 1 分钟
原文
文章信息与版本

文章信息

发布
2022年4月16日
收录
2025年12月12日
更新
2026年11月16日
篇幅
约 1 分钟
获赞
4

版本

  1. v1当前
  • A,B

Too easy to be necessary to say.

  • C

Knapsack and suffix sum.

  • D

Preprocess the occurrences of every number and use binary search for queries.

  • E

If K=1K=1, obviously the answer is Infinity\texttt{Infinity}.

Otherwise, enumrate two points. Ensure these points are the first two points on the line. If there are at least KK points, add one to the answer.

Use integer to avoid precision error.

  • F

Let dpi,j,0/1=dp_{i,j,0/1}= the number of ways to fill the first ii columns and throw away jj edges and the two points in the last column are connected/unconnected.

Time complexity: O(N2)O(N^2).

原文
存档评论31 条抓取于