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. spring boot 集成mybatis plus 含分页 完整教程

    一.添加依赖 <dependency> <groupId>com.baomidou</groupId> <artifactId>mybatis-plus ...

  2. oracle 查询 10题

    说明:表数据来自oracle 初始用户之一scott里面的三个初始表:emp,dept,salgrade --1.查询员工表中工资最高的雇员的员工号.员工姓名.工资和部门号. select empno ...

  3. OO——JML作业总结

    目录 第三单元博客作业 JML语言理论基础 1.注释结构 2.JML表达式 3.方法规格 4.类型规格 应用工具链 JMLUnitNG使用实例 作业架构设计 第一次作业 第二次作业 第三次作业 BUG ...

  4. 移动oracle数据文件的两种方法

    1.alter database方法该方法,可以移动任何表空间的数据文件. ***关闭数据库***SQL> shutdown immediateDatabase closed.Database ...

  5. c# 格式化数据String.Format

  6. Shodan information gathering use parameter

    1.we sue the Search Engines Shodan we can gather much information on the line web , such we want to ...

  7. requests-html模块(下)

    render方法 我们先理一下关系requests和的作者是同一个人,pyppeteer是nodejs中puppeteer的非官方实现 requests-html调用的pyppeteer与浏览器进行交 ...

  8. [openssl][nginx] 使用openssl模拟ssl/tls客户端测试nginx stream

    一 server的配置 nginx # cat conf/nginx.conf daemon off; events { debug_connection ; } stream { upstream ...

  9. linux-秘钥生成

    服务器sshd配置 #vim /etc/ssh/sshd_conf PubkeyAuthentication yes AuthorizedKeysFile .ssh/authorized_keys # ...

  10. linux上如何删除文件名乱码的文件

    这里写图片描述今天在服务上发现了两个文件名是乱码的文件,如图所示.这里写图片描述于是想用rm命令把它们删掉,但提示没有此文件. 网上搜了一下,找到解决方法,首先执行ls -i命令,此时在文件前面会出现 ...