Div2

A

长度为\(n(n≤10^5)\)的数组,每个元素不同,求有多少个位置\(d\)满足\(d - x \le j < d \And d < j \le d + y a_d<a_j(0\le x,y\le 7)\)

\(x,y\)较小,遍历每个位置,暴力判断即可

B

如下图,给出\(L,H\),求水面深度

设水面深度为\(x\),勾股定理:\(x^2+L^2=(x+H)^2\),解得\(x=\frac{L^2-H^2}{2H}\)

Div1

A

长度为\(n(1 \le n \le 4 \cdot 10^{5})\)的数组和\(I(1 \le I \le 10^{8})\),确定一个范围\([L,R]\),使得该范围内数组的元素个数\(K\)(\(满足\)\lceil log_{2} K \rceil\cdot n≤8I)$。求不在此范围内的元素最少为多少

得出最大\(K\),将原数组排序去重离散得到一个排列及每个数字出现的次数
转换为:\(1\~ tot\)的数字,给出每个数字出现的次数,选连续\(K\)个数字,求未选中数字的最小个数

判断选择\([1,K],[2,K+1],[n-K+1,n]\),没被选中的数字至多为首尾连续两段,预处理前缀和和后缀和暴力判断即可

B

长度为\(n\)的数组,和\(q\)次操作
两种操作\(1.a_x=p\),\(2.\)数组里小于\(x\)的全部修改为\(x\)

有没有写平衡树的呀
单独考虑\(a_x\),第一种操作的影响为最后一次修改\(x\)位置的值\(p\),第二种操作的影响为最后一次操作一后的每次操作

统计每个\(x\)最后一次操作一的位置,并对第二种操作统计最大后缀,最后取\(max\)

C

\(3\cdot n\)个点\(m\)条边,选出\(n\)大小的独立点集或独立边集\(1 \leq n \leq 10^{5},0 \leq m \leq 5 \cdot 10^{5}\)

随便选边,设独立边集为\(len\)

  • \(len≥n\):输出边集

  • \(len<n\):输出没在边集里的大小为\(n\)的点集\((\)点集的最大大小为\(3\cdot n-2(n-1)≥n)\)

D

\(n×n(1 \leq n \leq 50)\)的黑白色格子,将一块长\(h\)宽\(w\)的范围涂白,花费\(max(h,w)\),求全涂白的最小花费

普及组的暴力?\(f_{x,y,xx,yy}\)为将\((x,y)(xx,yy)\)范围全涂白的最小花费,记忆化搜索即可

E

F

Codeforces Round #576 (div.1 + div.2)的更多相关文章

  1. Educational Codeforces Round 60 (Rated for Div. 2) - C. Magic Ship

    Problem   Educational Codeforces Round 60 (Rated for Div. 2) - C. Magic Ship Time Limit: 2000 mSec P ...

  2. Educational Codeforces Round 60 (Rated for Div. 2) - D. Magic Gems(动态规划+矩阵快速幂)

    Problem   Educational Codeforces Round 60 (Rated for Div. 2) - D. Magic Gems Time Limit: 3000 mSec P ...

  3. Educational Codeforces Round 43 (Rated for Div. 2)

    Educational Codeforces Round 43 (Rated for Div. 2) https://codeforces.com/contest/976 A #include< ...

  4. Educational Codeforces Round 35 (Rated for Div. 2)

    Educational Codeforces Round 35 (Rated for Div. 2) https://codeforces.com/contest/911 A 模拟 #include& ...

  5. Codeforces Educational Codeforces Round 44 (Rated for Div. 2) F. Isomorphic Strings

    Codeforces Educational Codeforces Round 44 (Rated for Div. 2) F. Isomorphic Strings 题目连接: http://cod ...

  6. Codeforces Educational Codeforces Round 44 (Rated for Div. 2) E. Pencils and Boxes

    Codeforces Educational Codeforces Round 44 (Rated for Div. 2) E. Pencils and Boxes 题目连接: http://code ...

  7. Educational Codeforces Round 63 (Rated for Div. 2) 题解

    Educational Codeforces Round 63 (Rated for Div. 2)题解 题目链接 A. Reverse a Substring 给出一个字符串,现在可以对这个字符串进 ...

  8. Educational Codeforces Round 39 (Rated for Div. 2) G

    Educational Codeforces Round 39 (Rated for Div. 2) G 题意: 给一个序列\(a_i(1 <= a_i <= 10^{9}),2 < ...

  9. Educational Codeforces Round 48 (Rated for Div. 2) CD题解

    Educational Codeforces Round 48 (Rated for Div. 2) C. Vasya And The Mushrooms 题目链接:https://codeforce ...

  10. Educational Codeforces Round 60 (Rated for Div. 2) 题解

    Educational Codeforces Round 60 (Rated for Div. 2) 题目链接:https://codeforces.com/contest/1117 A. Best ...

随机推荐

  1. Ubuntu 下安装 OpenSSH Server

    Ubuntu 下安装 OpenSSH Server 是无比轻松的一件事情,需要的命令只有一条: sudo apt-get install openssh-server (查看返回的结果,如果没有出错, ...

  2. 快速精通Mac效率神器Alfred以及常用workflow

    概述 Alfred基础在上一篇 大纲 名称 作用 类别 出处 修改日期 Github 更便捷地使用Github 开发编程 Github 2017-01-28 Github Search Github搜 ...

  3. fatal: 不是一个有效的对象名:'master'。

    听说git比svn的branch功能好,所以装了个msysgit玩.执行完了git init操作后想建branch,用git branch develop命令,结果报错,说 fatal: Not a ...

  4. 【一起学源码-微服务】Netflix Eureka 源码一:Netflix Eureka 源码初探,我们为什么要读源码?

    前言 最近发现 网上好多自己的博客,很多朋友转载了文章却不加下 原载地址,本文欢迎转载一起学习,请在目录出加上原出处,感谢.转载来自:博客(一枝花算不算浪漫) 看了前面几篇文章的小伙伴知道,前几天在学 ...

  5. Python学习日记(十九) 模块导入

    模块导入 当文件夹中有这样一个自定义的command模块 在它的内部写下下列代码: print('这个py文件被调用!') def fuc(): print('这个函数被调用!') 然后我们在comm ...

  6. 关于MySql升级JDBC架包导致时区问题报错(The server time zone value '?й???????' is unrecognized or represents more than one time zone)

    报错信息: The server time zone value '?й???????' is unrecognized or represents more than one time zone. ...

  7. mybatis中如何将多个表的查询结果,放入结果集中返回

    1.首先需要将resultMap进行改造,为了避免对其他sql的影响建议另外定义一个resultMapExtral,避免id相同, 2.然后在resultMapExtral中添加其它表的字段,若多个表 ...

  8. mysql:[Err] 1075 - Incorrect table definition; there can be only one auto column and it must be defined as a key

    删除主键时,出错:[Err] 1075 - Incorrect table definition; there can be only one auto column and it must be d ...

  9. C++(三十八) — 继承方式、访问控制、构造和析构、虚继承

    派生类继承了基类的所有成员,但不包含 构造函数.析构函数.默认赋值运算符.  1.继承方式.访问控制 (1)protected属性:类的对象不能访问该属性成员,但派生类的成员函数可以访问基类的prot ...

  10. Not so Mobile UVA - 839(二叉树的先序遍历)

    #include<iostream> using namespace std; int solve(int &W) /*这里一定要用引用,为了赋给它值*/ { int wl, dl ...