用户工具

站点工具


2020-2021:teams:mian:cf_mashup:20200730

差别

这里会显示出您选择的修订版和当前版本之间的差别。

到此差别页面的链接

两侧同时换到之前的修订记录 前一修订版
后一修订版
前一修订版
2020-2021:teams:mian:cf_mashup:20200730 [2020/07/31 11:28]
gary
2020-2021:teams:mian:cf_mashup:20200730 [2020/08/04 19:19] (当前版本)
grapelemonade [解法]
行 524: 行 524:
 亦即我们可以仅对与 $m$ 数量级相当(或比其小)的砝码搜索。 亦即我们可以仅对与 $m$ 数量级相当(或比其小)的砝码搜索。
  
-当 $n=5$ 时,只需搜索到 $5^13=1,​220,​703,​125$ 即可。+当 $n=5$ 时,只需搜索到 $5^{13}=1,​220,​703,​125$ 即可。
  
 可见 $n>5$ 时,需要考虑的元素数量不超过 $13$。 可见 $n>5$ 时,需要考虑的元素数量不超过 $13$。
行 585: 行 585:
 Code as follows: Code as follows:
  
-<​hidden><​code>​+<​hidden><​code ​python>
 S = input() S = input()
 N = len(S) N = len(S)
行 623: 行 623:
 ===== W - Case of Fugitive (555B) ===== ===== W - Case of Fugitive (555B) =====
  
-  * Solved by **//QwQ//**+  * Solved by **//Withinlover//**
  
 ==== 题意 ==== ==== 题意 ====
 +
 +无限长的河流上有 $n$ 块石头,每一块用一个区间 $[l, r]$ 表示,你有 $m$ 块木板,每块的长度固定。
 +
 +你需要依次将着 $m$ 块石头用木板连起来,即1连2,2连3,3连4……
 +
 +询问是否存在摆放木板的方案,如果有,输出方案。
  
 ==== 解法 ==== ==== 解法 ====
  
 +$n$ 块石头之间需要 $n - 1$ 块木板,对木板长度的要求可以转换成 $n - 1$ 条形如 $[l, r]$ 的限制条件。木板的长度视为单点,就转换成了一个经典的贪心。
 ===== X - Case of Chocolate (555C) ===== ===== X - Case of Chocolate (555C) =====
  
行 673: 行 680:
 一些关键代码如下。 一些关键代码如下。
  
-<​hidden><​code>​+<​hidden><​code ​cpp>
 tuple<​Interval,​ Interval, int> Split (int pos, Direction dir) const { tuple<​Interval,​ Interval, int> Split (int pos, Direction dir) const {
   if(dir == UP)    if(dir == UP) 
2020-2021/teams/mian/cf_mashup/20200730.1596166088.txt.gz · 最后更改: 2020/07/31 11:28 由 gary