Codeforces Round #412 div2 ABCD
A 按rank给出每个人的赛前分数和赛后分数 如果一个人打败了比他分数高的人 他的分数必然升高 问比赛rated吗 如果一个人的分数改变了肯定rate 如果全都没改的话 也可能是rated 这时候check分数是否递增
B 给出一个伪代码 用你的分数放进去可以生成25个rank 给出你的rank 你的现在分数x 你的最低分数y 问你hack(成功 +100 失败 - 50)成功最少多少次能够让自己的分数变化后放入这个伪代码生成的25个rank里面包含你的rank
先枚举只失败的 直到不能再失败
如果不行就枚举 成功次数 (每次都尝试失败一次)
C 你现在提交了b次 对了a次 你期望AC/SUBMIT比值是p/q 问最少提交多少次可以 或者确定不可以
让这个比值翻倍 二分翻的倍数并最小化 check 条件是 当b -> ans * q 可否实现 a -> p * ans
D 一场比赛有五道题 每道题的分数由一个通过人数和比赛总人数的比值决定 每个人在一道题上的分数由通过时间和题目总分决定 有n个人比赛 1想通过建小号的方式打败2 问最少建多少个或者确定不可以
可以看到比值最小是1/32 最大是1/2 并且n<=120 所以可以想到如果想并且有能力调控题目分数的话 需要建的小号不会太多 所以直接枚举check
需要注意的是 如果我想让A题多几个AC人数来刷低题目分数 这些人将被视为参赛者 会影响其余的题目的分数
没有看明白这个条件的我敲了一天的暴力搜索每题的总分。。打出一万个BUG。。可能已经是一条咸鱼了。。
#include<stdio.h>
#include<string.h>
#include<algorithm>
#include<math.h>
#include<map>
#include<string>
#include<vector>
#include<queue>
#include<iostream>
using namespace std ;
#define L long long
#define pb push_back int n ;
int a[130][10] ;
int b[10] ;
int m ; int fs[8] = {0,500,1000,1500,2000,2500,3000} ;
int js[8] = {0,1,2,4,8,16,32} ; int zh(int x , int nn) {
if(x * 32 <= nn) return 6 ;
if(x * 16 <= nn) return 5 ;
if(x * 8 <= nn) return 4 ;
if(x * 4 <= nn) return 3 ;
if(x * 2 <= nn) return 2 ;
return 1 ;
} int vol[10][10] ; int lv[20] ;
int c[20] ;
int d[20] ; int main () {
cin >> n ;
memset(b, 0 , sizeof(b)) ;
for(int i = 1 ; i <= n ; i ++ ) {
for(int j = 1 ; j <= 5 ; j ++ ) {
cin >> a[i][j] ;
if(a[i][j] != -1) {
b[j] ++ ;
}
}
} for(int ans = 0 ; ans <= 3200000 ; ans ++ ) {
int df1 = 0 , df2 = 0 ;
for(int i = 1 ; i <= 5 ; i ++ ) {
d[i] = b[i] ;
if(a[1][i] == -1) continue ;
if(a[2][i] == -1) continue ;
if(a[1][i] > a[2][i]) {
d[i] = b[i] + ans ;
}
}
for(int i = 1 ; i <= 5 ; i ++ ) {
if(a[1][i] != -1) df1 += fs[zh(d[i] , n + ans)] / 250 * (250 - a[1][i]) ;
if(a[2][i] != -1) df2 += fs[zh(d[i] , n + ans)] / 250 * (250 - a[2][i]) ;
}
if(df1 > df2) {
printf("%d\n" , ans) ;
return 0;
}
if(ans == 3200000) {
printf("-1\n") ;
}
}
}
Codeforces Round #412 div2 ABCD的更多相关文章
- Codeforces Round #539 div2
Codeforces Round #539 div2 abstract I 离散化三连 sort(pos.begin(), pos.end()); pos.erase(unique(pos.begin ...
- 【前行】◇第3站◇ Codeforces Round #512 Div2
[第3站]Codeforces Round #512 Div2 第三题莫名卡半天……一堆细节没处理,改一个发现还有一个……然后就炸了,罚了一啪啦时间 Rating又掉了……但是没什么,比上一次好多了: ...
- Codeforces Round#320 Div2 解题报告
Codeforces Round#320 Div2 先做个标题党,骗骗访问量,结束后再来写咯. codeforces 579A Raising Bacteria codeforces 579B Fin ...
- Codeforces Round #564(div2)
Codeforces Round #564(div2) 本来以为是送分场,结果成了送命场. 菜是原罪 A SB题,上来读不懂题就交WA了一发,代码就不粘了 B 简单构造 很明显,\(n*n\)的矩阵可 ...
- Codeforces Round #361 div2
ProblemA(Codeforces Round 689A): 题意: 给一个手势, 问这个手势是否是唯一. 思路: 暴力, 模拟将这个手势上下左右移动一次看是否还在键盘上即可. 代码: #incl ...
- 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 Div.2
A. Is it rated? 题面 Is it rated? Here it is. The Ultimate Question of Competitive Programming, Codefo ...
- 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 ...
随机推荐
- 多进程端口监听 How nginx processes a request Server names
网络编程( 六):端口那些事儿 - 知乎专栏 https://zhuanlan.zhihu.com/p/20365900 不停服务reload.restart 多进程端口监听 我们都有一个计算机网络 ...
- Selenium IDE的使用
Selenium IDE 的作用 Selenium IDE 是Firefox 浏览器的一个插件, 它会记录你对Firefox的操作,并且可以回放它的操作. 在实际自动化测试中,不会用Selenium ...
- ffmpeg参数使用说明2
附录一(ffmpeg参数说明): [参数] [说明] [示例] -i "路径" 指定需要转换的文件路径 -i "C:\nba.wmv" -y 覆盖输出文件,即如 ...
- issubclass/type/isinstance、函数和方法、反射、callable、特殊成员补充
一.issubclass/type/isinstance(***) 1.issubclass(参数1, 参数2):检查第一个参数是否是第二个参数的 子子孙孙类,如下示例: class Base(obj ...
- selenium屏蔽谷歌浏览器弹出的通知
使用chromeoptions来修改浏览器的设置 from selenium import webdriver import time options = webdriver.ChromeOption ...
- kubernetes 1.7.2 安装 记录过程
系统信息 cat /etc/redhat-release CentOS Linux release (Core) 环境信息 IP地址 主机名称 10.10.6.11 master 10.10.6.12 ...
- 阿里云下 centos7下启动程序总是被killed ,看内存占用情况以检查哪些服务存在问题并调整参数作调优
很久不搭理自己的网站了,几天突然发现启动程序总是被killed, 于是查看了系统日志 vi /var/log/messages 发现出现 kernel: Out of memory: Kill pro ...
- app开发流程有哪些
app开发流程是需求方和供求方相互协调的过程,一般分为需求分析.功能设计.功能实现.项目测试.上线等几个步骤,下面我们就来一起看看ytkah团队进行app开发各个流程主要做哪些事情,让您对app开发设 ...
- Python编码规范 -- Python Style Guide
Python代码风格规范. @1:参数缩进:(2种形式) <1> foo = long_function_name(var1, var2, var3, var4) #第1行有参数, 第2行 ...
- C#中的foreach和yield
1. foreach C#编译器会把foreach语句转换为IEnumerable接口的方法和属性. foreach (Person p in persons) { Console.WriteLine ...