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 ...
随机推荐
- Python学习笔记(三)字符串类型及其操作(2)
1.字符串的表示 字符串是字符的序列表示,可以由一对单引号(‘).双引号(“)或三引号(’‘’)构成.其中,单引号.双引号和三引号都可以表示单行字符串,但是只有三引号可以表示多行字符串 在使用双引号时 ...
- 50道python面试题
1.大数据的文件读取 ① 利用生成器generator ②迭代器进行迭代遍历:for line in file 2.迭代器和生成器的区别 1)迭代器是一个更抽象的概念,任何对象,如果它的类有next方 ...
- jmeter的运行原理和测试计划要素
jmeter运行原理 1.jmeter运行在JVM虚拟机上,jmeter是以线程的方式运行的. 2.jmeter通过线程组来驱动多个线程,运行测试脚本对被测试服务器发起负载,每一个负载机上够可以运行多 ...
- 聊聊jdk http的HeaderFilter
序 本文主要研究一下jdk http的HeaderFilter. FilterFactory java.net.http/jdk/internal/net/http/FilterFactory.jav ...
- 如何在iPhone 显示一个 星级评分
http://blog.csdn.net/fanjunxi1990/article/details/8663914 由于项目需求,需要做一个列表,里面有各个商品的评分,就是app store里面所有a ...
- bzoj1579 道路升级
Description 每天,农夫John需要经过一些道路去检查牛棚N里面的牛. 农场上有M(1<=M<=50,000)条双向泥土道路,编号为1..M. 道路i连接牛棚P1_i和P2_i ...
- UVA_10071:Back to High School Physics
Language:C++ 4.8.2 #include<stdio.h> int main(void) { int v, t; while(scanf("%d%d", ...
- Azkaban3.x
Azkaban3.x安装部署 官方文档地址 三种模式 solo-server模式:exec进程和web进程为同一个进程,存放元数据的数据库为H2 two-server模式:与之前的单机版本类似,exe ...
- 实现一个简易的promise
//promise里面只有三个状态,且三个状态的转换形式有两种 //由pending转换为fulfilled,由pending转换为rejected //Promise的构造函数参数是一个函数,函数的 ...
- nodeJs学习-05 案例:http/fs/querystring/url
const http = require('http'); const fs = require('fs'); const querystring = require('querystring'); ...