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的更多相关文章

  1. 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 ...

  2. VK Cup 2017 - Квалификация 1

    CF上的VK Cup 2017资格赛1,好像很水,因为只有俄文所以语言是最大的障碍--不过之后正式赛貌似就有英文了.(比赛貌似只有开俄文模式才看的到--) 时长1天,不随时间扣分.FallDream ...

  3. 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 ...

  4. 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 ...

  5. 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 ...

  6. 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 ...

  7. 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 ...

  8. 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 =  ...

  9. 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 ...

随机推荐

  1. C# List<string> 的Contains方法 是区分大小写的

    List<string> 的Contains  是区分大小写的 代码: List<string> test = new List<string>(); test.A ...

  2. 令自己的本地ip可以被外网访问

    https://www.ngrok.cc/_book/general/open.html

  3. 教程:将应用迁移到 DirectX* 12 – 第 1 部分

    原文地址 简介 随着微软* 新版操作系统 Windows 10* 的发布,核心图形技术将升级到最新的 DirectX* 12.要帮助拥有 DirectX* 开发经验的程序员熟悉 DirectX* 12 ...

  4. 【xml_Class、xmlElementNode_Class 类】使用说明

    xml_Class.xmlElementNode_Class这两个类是针对XML相关操作的类. 1.xml_Class类是针对XML文档操作的类 目录: 类型 原型 参数 返回 说明 Sub Sub ...

  5. 1.6 JAVA高并发之线程池

    一.JAVA高级并发 1.5JDK之后引入高级并发特性,大多数的特性在java.util.concurrent 包中,是专门用于多线程发编程的,充分利用了现代多处理器和多核心系统的功能以编写大规模并发 ...

  6. Oracle集合

    --union 并集 select * from emp where ename like '%A%' union select * from emp where ename like '%M%'; ...

  7. redis 为什么快

    redis采用自己实现的事件分离器,效率比较高,内部采用非阻塞的执行方式,吞吐能力比较大. 不过,因为一般的内存操作都是简单存取操作,线程占用时间相对较短,主要问题在io上,因此,redis这种模型是 ...

  8. Numpy入门笔记第二天

    # 数组的组合 import numpy as np arr1 = np.arange(5) arr2 = np.arange(3) print arr1 print arr2 [0 1 2 3 4] ...

  9. 3D打印产业链全景图

  10. Scrum立会报告+燃尽图(Beta阶段第五次)

    此作业要求参见:https://edu.cnblogs.com/campus/nenu/2018fall/homework/2387 项目地址:https://coding.net/u/wuyy694 ...