VK Cup 2017 Round 3 + Codeforces Round #412
A 读题题
B 就是你排名第p,得了x分,而最终至少需要y分,你需要最少的successful hack,使得最终得分s>=y,且由s随机取25个数,使p被选中。
(1)暴力枚举hack成功几次,失败几次就好了
(2)另解:枚举尽可能小的s,使|s-x|=0(mod 50),分类讨论
If s ≤ x, we need 0 successful hacks, since we can just make (x - s) / 50 unsuccessful hacks.
If s > x and s - x is divisible by 100, we need exactly (s - x) / 100 successful hacks.
If s > x and s - x is not divisible by 100, we need (s - x + 50) / 100 successful hacks and one unsuccessful hack.
C 一看到题就打了exgcd,调了一晚上,各种看错,最后发现爆long long了。。
其实列个不等式解就好了
D 一道读题题??
这道题的N最大为120,现在考虑极端的例子,假设有N个人,全都通过了这道题,如果想让通过率变为最小的,也就是1/32,那么最多也只需要开32倍的小号(或者33倍?)
反之,如果通过率为0想变成1/2 是2倍的N,所以这道题可以暴力枚举开小号的个数,然后在贪心决定这些小号在每道题上通过与否.
然后就过了。 数据范围这么小,看懂题不就会做了吗。。
E 贪心+二分
假设能分成m条链 && m<c(1) 显然可以把多余的1从某条链中取出 形成m+1条,则只要二分找到最小成立的m
判定当链数为x,即加r次数<=x。
贪心:
1.每次取链都尽可能长,直到不能取为止(显然链越长,越能容纳多出来的数,况且能少一个多余的数)
2.从大的数开始放,每次只要放在最长链上就好啦
另解:一个一个枚举,每次贪心地放置一条链。只需预处理出log a(a为input的最大值)组数(2的a次幂放到a,否则求出它能放的最短链长)
O(n log a)
VK Cup 2017 Round 3 + Codeforces Round #412的更多相关文章
- Codeforces Round #405 (rated, Div. 2, based on VK Cup 2017 Round 1) 菜鸡只会ABC!
Codeforces Round #405 (rated, Div. 2, based on VK Cup 2017 Round 1) 全场题解 菜鸡只会A+B+C,呈上题解: A. Bear and ...
- VK Cup 2017 - Квалификация 1
CF上的VK Cup 2017资格赛1,好像很水,因为只有俄文所以语言是最大的障碍--不过之后正式赛貌似就有英文了.(比赛貌似只有开俄文模式才看的到--) 时长1天,不随时间扣分.FallDream ...
- Codeforces Round #412 (rated, Div. 2, base on VK Cup 2017 Round 3)(A.B.C,3道暴力题,C可二分求解)
A. Is it rated? time limit per test:2 seconds memory limit per test:256 megabytes input:standard inp ...
- Codeforces Round #412 (rated, Div. 2, base on VK Cup 2017 Round 3) A B C D 水 模拟 二分 贪心
A. Is it rated? time limit per test 2 seconds memory limit per test 256 megabytes input standard inp ...
- Codeforces Round #412 (rated, Div. 2, base on VK Cup 2017 Round 3) D - Dynamic Problem Scoring
地址:http://codeforces.com/contest/807/problem/D 题目: D. Dynamic Problem Scoring time limit per test 2 ...
- Codeforces Round #423 (Div. 2, rated, based on VK Cup Finals) Problem E (Codeforces 828E) - 分块
Everyone knows that DNA strands consist of nucleotides. There are four types of nucleotides: "A ...
- Codeforces Round #412 (rated, Div. 2, base on VK Cup 2017 Round 3) A Is it rated?
地址:http://codeforces.com/contest/807/problem/C 题目: C. Success Rate time limit per test 2 seconds mem ...
- Codeforces Round #412 (rated, Div. 2, base on VK Cup 2017 Round 3) E. Prairie Partition 二分+贪心
E. Prairie Partition It can be shown that any positive integer x can be uniquely represented as x = ...
- Codeforces Round #409 (rated, Div. 2, based on VK Cup 2017 Round 2)(A.思维题,B.思维题)
A. Vicious Keyboard time limit per test:2 seconds memory limit per test:256 megabytes input:standard ...
随机推荐
- SQL基本数据类型等
bit 类似C#中的bool类型 true/false int 整型 nvarchar 字符串类型 float 小数型 decimal(,) 小数型 (限制小数位数) dateti ...
- 解决xampp启动mysql失败
进入到注册表内 命令:regedit 进入到路径:计算机\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\MySQL 修改路径为:" ...
- mongodb windows 4 zip安装
安装mongoDB目的:学习Express,顺带mongodb. 本文目的: 4.0.2的mongodb在windows7上竟然安装不了. 没办法,用压缩包手动安装吧... 安装环境:win7sp1x ...
- 《Cocos2d-x游戏开发实战精解》学习笔记2--在Cocos2d-x中显示一行文字
在Cocos2d-x中要显示文字就需要用到Label控件.在3.x版本的Cocos2d中,舍弃了之前版本所使用的LabelTTF.LabelAtlas.LabelBMFont 3个用于显示文字的类,而 ...
- [Algorithm] A* Search Algorithm Basic
A* is a best-first search, meaning that it solves problems by searching amoung all possible paths to ...
- java面向对象的冒泡排序,选择排序和插入排序的比较
这三种排序有俩个过程: 1.比较俩个数据. 2.交换俩个数据或复制其中一项. 这三种排序的时间级别 冒泡排序:比较 (N-1)+(N-2)+...+2+1 = N*(N-1)/2=N2/2 交换 0 ...
- OpenFlow协议
功能 1.0版本Openflow:控制器通过Openflow协议与交换机建立了安全通道(Sceure Channel),下发流表. 1.3版本Openflow:多控制器,多流表. 用于实现Contro ...
- Alpha 冲刺(10/10)
队名 火箭少男100 组长博客 林燊大哥 作业博客 Alpha 冲鸭鸭鸭鸭鸭鸭鸭鸭鸭鸭! 成员冲刺阶段情况 林燊(组长) 过去两天完成了哪些任务 协调各成员之间的工作 测试整体软件 展示GitHub当 ...
- CDOJ ABCDE dp(前缀和优化)
题目链接: http://acm.uestc.edu.cn/#/problem/show/1307 ABCDE Time Limit: 1000/1000MS (Java/Others)Memory ...
- Alpha阶段敏捷冲刺 ADY8
一.举行站立式例会 今天也没有拍照片,人不齐. 二.团队报告 1.昨日已完成的工作 (1)创建一个test,并且将图片导入进去使其可以显示. 2.今日计划完成的工作 完成收尾工作.实现代码的连接. 3 ...