A. Ilya and Bank Account

  • 模拟。

B. Ilya and Queries

  • 前缀和。

C. Ilya and Matrix

  • 考虑每个元素的贡献。
  • 边长为\(2^n\)时,贡献为最大值;
  • 边长为\(2^{n-1}\)时,贡献为前4大值;
  • 边长为\(2^{n-2}\)时,贡献为前16大值;
  • 以此类推。

D. Ilya and Roads

  • \(dp(i,j)\)表示前\(i\)个洞修复了\(j\)个的最小代价。
  • \(dp(i,j)=min\{dp(k,j-(i-k))+c\}\),\(c\)是\(r=i\)的所有公司。
  • 根据转移式子,很容易想到区间最小值问题,一开始用线段树,然后对公司的\(l_i\)排序,可以利用单调栈优化。

E. Ilya and Two Numbers

  • 贪心(自己也不太会),大概是先凑成\(m-1\),否则凑\(、、m-2、m-3、...\)
  • 具体可能还是要看代码
  • 官方题解

Codeforces Round #186 (Div. 2)的更多相关文章

  1. 递推 Codeforces Round #186 (Div. 2) B. Ilya and Queries

    题目传送门 /* 递推:用cnt记录前缀值,查询区间时,两个区间相减 */ #include <cstdio> #include <algorithm> #include &l ...

  2. [Codeforces Round #186 (Div. 2)] B. Ilya and Queries

    B. Ilya and Queries time limit per test 2 seconds memory limit per test 256 megabytes input standard ...

  3. [Codeforces Round #186 (Div. 2)] A. Ilya and Bank Account

    A. Ilya and Bank Account time limit per test 2 seconds memory limit per test 256 megabytes input sta ...

  4. Codeforces Round #186 (Div. 2).D

    纠结的一道dp. 状态转移方程还是比较好想的,优化比较纠结 D. Ilya and Roads time limit per test 3 seconds memory limit per test ...

  5. Codeforces Round #366 (Div. 2) ABC

    Codeforces Round #366 (Div. 2) A I hate that I love that I hate it水题 #I hate that I love that I hate ...

  6. Codeforces Round #354 (Div. 2) ABCD

    Codeforces Round #354 (Div. 2) Problems     # Name     A Nicholas and Permutation standard input/out ...

  7. Codeforces Round #368 (Div. 2)

    直达–>Codeforces Round #368 (Div. 2) A Brain’s Photos 给你一个NxM的矩阵,一个字母代表一种颜色,如果有”C”,”M”,”Y”三种中任意一种就输 ...

  8. cf之路,1,Codeforces Round #345 (Div. 2)

     cf之路,1,Codeforces Round #345 (Div. 2) ps:昨天第一次参加cf比赛,比赛之前为了熟悉下cf比赛题目的难度.所以做了round#345连试试水的深浅.....   ...

  9. Codeforces Round #279 (Div. 2) ABCDE

    Codeforces Round #279 (Div. 2) 做得我都变绿了! Problems     # Name     A Team Olympiad standard input/outpu ...

随机推荐

  1. yii常用操作数据

    yii常用操作数据.php <?php defined('YII_DEBUG') or define('YII_DEBUG', true); //当在调试模式下,应用会保留更多日志信息,如果抛出 ...

  2. 开启php中短标签<%%>和<??>的方法

    <?  ?> 短标签,兼容的,PHP默认也不支持,需要在php的配置文件中设置! 去到php.ini中开启下面的 <%  %> ASP风格!也是兼容的,也需要配置:

  3. 解决Apache日志"internal dummy connection"方法

    最近查看服务器中apache日志,发现有大量的 OPTIONS * HTTP/1.0" 200 - "-" "Apache (internal dummy co ...

  4. idea导入gradle项目后,找不到右边gradle窗口

    解决方案:关闭当前项目idea,随便打开个其他的项目 选择你刚刚的gradle项目 一定要选择你的gradle文件,然后OK就行了..剩下的按照指示打开就会显示gradle右边窗了 原文弟子:http ...

  5. c++编译错误:invalid new-expression of abstract class type

    原因: 出现这个错误原因是new 了一个抽象类出错,说明父类(接口)中有纯虚函数没有实现.接口里的纯虚函数全部需要实现,这样才能new 子类. 例如: 纯虚函数例如 ; 是纯虚函数,不是纯虚函数不作要 ...

  6. matlab 单元最短路 Dijkstra算法 无向图

    W = [2 8 1 1 6 5 1 2 3 6 4 9 3 7 9]; S = [0 0 0 1 1 3 3 3 5 5 6 4 6 2 2];S=S+1; T = [1 3 2 4 3 4 5 6 ...

  7. vmware中配置CentOS

    一.下载 http://mirrors.aliyun.com/centos/7.6.1810/isos/x86_64/CentOS-7-x86_64-DVD-1810.iso 这里选择的是阿里云镜像 ...

  8. Cython保护Python代码

    注:.pyc也有一定的保护性,容易被反编译出源码... 项目发布时,为防止源码泄露,需要对源码进行一定的保护机制,本文使用Cython将.py文件转为.so进行保护.这一方法,虽仍能被反编译,但难度会 ...

  9. 注意特殊情况!最长上升子序列!!poj2533

    poj 2533 简单的动归.用O(n^2)的算法也能过.但是有个细节!刚开始ans初始化为0时是错的!!!要初始化为1.因为只有1个数的时候,下面的循环是不会执行的.....或者特判.. #incl ...

  10. python if elif else 区别

    if data_ori=='医疗': # 医疗 df = pd.read_excel(path_apply + 'apply/YS_ZY_HZSQ_样例.xls', encoding='gbk', e ...