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. selenium 结合 docker 构建分布式测试环境 (初学者视角)

    前言:随着自动化测试越学越深,深深觉得有太多的东西需要总结. 1.记录下学习中遇到的坑,当做学习笔记.2.有前人路过看到文章中比较落后的做法,请务必一定要指教.(因为是初学者视角,很多东西只是走通而已 ...

  2. 测试Websocket建立通信,使用protobuf格式交换数据

    接到一个应用测试,应用实现主要使用websocket保持长链接,使用protobuf格式交换数据,用途为发送消息,需要我们测试评估性能,初步评估需要测试长链接数.峰值消息数以及长期运行稳定性 整体需求 ...

  3. Spring框架 之IOC容器 和AOP详解

    主要分析点: 一.Spring开源框架的简介  二.Spring下IOC容器和DI(依赖注入Dependency injection) 三.Spring下面向切面编程(AOP)和事务管理配置  一.S ...

  4. python数据可视化——matplotlib 用户手册入门:pyplot 画图

    参考matplotlib官方指南: https://matplotlib.org/tutorials/introductory/pyplot.html#sphx-glr-tutorials-intro ...

  5. nginx gzip压缩配置

    gzip(GNU-ZIP)是一种压缩技术.经过gzip压缩后页面大小可以变为原来的30%甚至更小,这样,用户浏览页面的时候速度会块得多.gzip 的压缩页面需要浏览器和服务器双方都支持,实际上就是服务 ...

  6. redis 常用命令 结合php

    这篇文章主要介绍了30个php操作redis常用方法代码例子,本文其实不止30个方法,可以操作string类型.list类型和set类型的数据,需要的朋友可以参考下     redis的操作很多的,以 ...

  7. 针对某一网站的UI进行分析

    本周课上教学通过对PM(项目经理)的学习,我了解到PM 对项目所有功能的把握, 特别是有关的UI内容.最差的UI, 体现了团队的组织架构:其次, 体现了产品的内部结构:最好, 体现了用户的自然需求. ...

  8. Android开发第二阶段(5)

    今天:对图片的替换修改,使整个app的图案化更美观. 明天:对Android的对sdcard的操作学习

  9. iOS-UICollectionViewController协议及回调

    一.UICollectionViewDataSource 1.返回Section数量的方法 - (NSInteger)numberOfSectionsInCollectionView: (UIColl ...

  10. Objective - C 之延展

    延展:为已有的类新增私有方法,只能在本类中使用 一.创建过程: 二.总结: 1.延展只有.h文件,在其中写新方法的声明,在原本的类(Person)中写方法的实现: 2.上述的方法其实很不安全,因为如果 ...