Codeforces Round #196 (Div. 1 + Div. 2)
A. Puzzles
- 对\(f[]\)排序,取连续的\(m\)个。
B. Routine Problem
- 考虑\(\frac{a}{b}\)和\(\frac{c}{d}\)的大小关系,适配后就是分数的运算。
C. Quiz
- 按\(k\)将\(n\)个问题分段,那么在没有分数翻倍的情况下最大题数为\[(k-1)\lfloor\frac{n}{k}\rfloor+n\%k\]
- 若\(m\le (k-1)\lfloor\frac{n}{k}\rfloor+n\%k\),则最大分数就为\(m\),否则翻倍的机会放到前面的若干段上。
D. Book of Evil
- 问题转化为计算每个点到\(p_i\)的最大距离,若距离大于\(d\),显然不会是问题要的点。
- 最大距离两遍\(dfs\)即可。
E. Divisor Tree
- 每个\(a_i\)的点的父节点只会是根节点或者其他\(a_j>a_i\)的点上。
- 所以将\(a[]\)从大到小排序后,暴力建树,时间复杂度\(O(n!)\)。
F. GCD Table
- 模线性方程合并。
- 在合并过程中,需要注意过程变量会超\(long\ long\),一种解决办法是快速乘,一种是利用题目解的范围在\(10^{12}\)内,合并时使用较小的模数。
G. Optimize!
- 问题相当于对于\(a\)每个长为\(len\)的连续子序列,判断是否存在\(b\)一种排列,使得对应位置\(a_i+b_i\ge h\)。
- 如果将\(b[]\)从小到大排序,每个\(a\)的连续子序列从大到小排序,此时就是最优匹配。
- 考虑单个\(a_i\),每个\(a_i\)都存在一个最小的\(b_j\)使得和大于等于\(h\),也就是比\(a_i\)大值至少有\(j-1\),否则\(a_i\)会导致当前的子序列不合法。
- 最后就是线段树用值(排名)建树,维护长为\(len\)的区间,区间覆盖,查询全局最小值。
Codeforces Round #196 (Div. 1 + Div. 2)的更多相关文章
- 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 ...
- 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 ...
- Educational Codeforces Round 43 (Rated for Div. 2)
Educational Codeforces Round 43 (Rated for Div. 2) https://codeforces.com/contest/976 A #include< ...
- Educational Codeforces Round 35 (Rated for Div. 2)
Educational Codeforces Round 35 (Rated for Div. 2) https://codeforces.com/contest/911 A 模拟 #include& ...
- 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 ...
- 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 ...
- Educational Codeforces Round 63 (Rated for Div. 2) 题解
Educational Codeforces Round 63 (Rated for Div. 2)题解 题目链接 A. Reverse a Substring 给出一个字符串,现在可以对这个字符串进 ...
- 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 < ...
- Educational Codeforces Round 48 (Rated for Div. 2) CD题解
Educational Codeforces Round 48 (Rated for Div. 2) C. Vasya And The Mushrooms 题目链接:https://codeforce ...
- Educational Codeforces Round 60 (Rated for Div. 2) 题解
Educational Codeforces Round 60 (Rated for Div. 2) 题目链接:https://codeforces.com/contest/1117 A. Best ...
随机推荐
- django1.11启动错误
错误信息: 复制代码 Unhandled exception in thread started by <function check_errors..wrapper at 0x10f03b8c ...
- 【水滴石穿】React Native 组件之SafeAreaView
本文转载自:https://blog.csdn.net/xiangzhihong8/article/details/80692792 SafeAreaView简介 ReactNative官方从0.50 ...
- BOT建设经营转让,PPP公私合作
PPP.BOT两种模式有什么区别? BOT模式(build-operate-transfer),由投资方建设并专营一定期限最后移交政府的方式:PPP模式(public-private-partners ...
- 2019-8-31-asp-dotnet-core-支持客户端上传文件
title author date CreateTime categories asp dotnet core 支持客户端上传文件 lindexi 2019-08-31 16:55:58 +0800 ...
- oracle审计的格式
audit table; audit table by xxx(username); audit table by xxx(username) whenever not successful; 系统表 ...
- 【风马一族_软件】微软卸载工具_msicuu2.exe
msicuu2.exe是微软的Windows Installer清理工具,可以用来清理微软安装包软件产生的垃圾,当然也可以拿来作为修复相关软件的卸载准备使用 下载链接:http://files.cnb ...
- md5小工具
<?php$str = "123456";echo md5($str);?>
- Length of Last Word输出最后单词的字母个数
Given a string s consists of upper/lower-case alphabets and empty space characters ' ', return the l ...
- SDUT-2804_数据结构实验之二叉树八:(中序后序)求二叉树的深度
数据结构实验之二叉树八:(中序后序)求二叉树的深度 Time Limit: 1000 ms Memory Limit: 65536 KiB Problem Description 已知一颗二叉树的中序 ...
- Linux的 crontab定时任务小记
编辑任务 crontab -e 查看任务 crontab -l 任务配置基本格式:* * * * * command分(0-59) 时(0-23) 天(1-31) 月(1-12) 周(0-6,0代 ...