Codeforces Round #186 (Div. 2)
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
Codeforces Round #186 (Div. 2)的更多相关文章
- 递推 Codeforces Round #186 (Div. 2) B. Ilya and Queries
题目传送门 /* 递推:用cnt记录前缀值,查询区间时,两个区间相减 */ #include <cstdio> #include <algorithm> #include &l ...
- [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 ...
- [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 ...
- Codeforces Round #186 (Div. 2).D
纠结的一道dp. 状态转移方程还是比较好想的,优化比较纠结 D. Ilya and Roads time limit per test 3 seconds memory limit per test ...
- 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 ...
- Codeforces Round #354 (Div. 2) ABCD
Codeforces Round #354 (Div. 2) Problems # Name A Nicholas and Permutation standard input/out ...
- Codeforces Round #368 (Div. 2)
直达–>Codeforces Round #368 (Div. 2) A Brain’s Photos 给你一个NxM的矩阵,一个字母代表一种颜色,如果有”C”,”M”,”Y”三种中任意一种就输 ...
- cf之路,1,Codeforces Round #345 (Div. 2)
cf之路,1,Codeforces Round #345 (Div. 2) ps:昨天第一次参加cf比赛,比赛之前为了熟悉下cf比赛题目的难度.所以做了round#345连试试水的深浅..... ...
- Codeforces Round #279 (Div. 2) ABCDE
Codeforces Round #279 (Div. 2) 做得我都变绿了! Problems # Name A Team Olympiad standard input/outpu ...
随机推荐
- querySelector与getElementBy系列的区别
getElementBy系列 document.getElementsByTagName('tag'); document.getElementById('id'); document.getElem ...
- JavaScript--放大镜
上例图: <!DOCTYPE html> <html> <head lang="en"> <meta charset="UTF- ...
- 洛谷 P3958 奶酪 并查集
目录 题面 题目链接 题面 题目描述 输入输出格式 输入格式 输出格式: 输入输出样例 输入样例 输出样例 说明 思路 AC代码 总结 题面 题目链接 P3958 奶酪 题面 题目描述 现有一块大奶酪 ...
- beanstalkd 启动跟停止
启动命令: nohup /usr/bin/beanstalkd -l xxx.xxx.xxx.xxx -p 11300 & >> /dev/null 2>&1 正常启 ...
- 三角形数且是完全平方数 2017 ACM-ICPC 亚洲区(乌鲁木齐赛区)网络赛 E.Half-consecutive Numbers
三角形数:an=n*(n+1)/2; 完全平方数:bn=c^2; 既是三角形数又是完全平方数:An=6*A(n-1)-A(n-2)+2; A[23]={ 0, 1, 8, 49, 288, 1681, ...
- c++ 对象池的创建
template <class T> class ObjectPool { public: using DeleterType = std::function<void(T*)> ...
- F4NNIU 的 KiCad EDA 技巧 (2019-05-09 更新)
F4NNIU 的 KiCad EDA 技巧 已经慢慢切换到 KiCadEDA 上来画板,优点很多. 开源: 自动推挤: 无限的元件库: 强大的 3D 显示: 这里整理一下个人使用的技巧: 原理图 Ee ...
- Java练习 SDUT-1586_计算组合数
计算组合数 Time Limit: 1000 ms Memory Limit: 32768 KiB Problem Description 计算组合数.C(n,m),表示从n个数中选择m个的组合数. ...
- 伪元素 before 和 after 各种妙用
大家可能对伪类和伪元素有点迷糊,在介绍具体用法之前,简单介绍下伪类和伪元素.伪类大家听的多了,伪元素可能听到的不是那么频繁,其实 CSS 对这两个是有区分的. 这里整理总结下: 有时你会发现伪类元素使 ...
- LeetCode59 Spiral Matrix II
题目: Given an integer n, generate a square matrix filled with elements from 1 to n2 in spiral order. ...