AC日记——Dynamic Problem Scoring codeforces 807d
思路:
水题;
代码:
#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm> using namespace std; #define maxn 130 int n,ai[maxn][],ac[],cnt,all,last1,last2; double map[][]; inline void in(int &now)
{
int if_z=;now=;
char Cget=getchar();
while(Cget>''||Cget<'')
{
if(Cget=='-') if_z=-;
Cget=getchar();
}
while(Cget>=''&&Cget<='')
{
now=now*+Cget-'';
Cget=getchar();
}
now*=if_z;
} int point(int a,int s,int t)
{
if(t==-) return ;
int res=;
double p=(double)a/(double)s;
if(p>0.5&&p<=) res+=-*t;
else if(p>0.25&&p<=0.5) res+=-*t;
else if(p>0.125&&p<=0.25) res+=-t*;
else if(p>0.0625&&p<=0.125) res+=-t*;
else if(p>0.03125&&p<=0.0625) res+=-t*;
else if(p>&&p<=0.03125) res+=-t*;
return res;
} int main()
{
in(n);
for(int i=;i<=n;i++)
{
for(int j=;j<=;j++)
{
in(ai[i][j]);
if(ai[i][j]!=-) ac[j]++;
}
}
for(int i=;i<=;i++)
{
last1+=point(ac[i],n,ai[][i]);
last2+=point(ac[i],n,ai[][i]);
}
cnt=n;
if(last1>last2)
{
printf("");
return ;
}
for(int j=;j<=;j++)
{
cnt++;
int sco1=,sco2=;
bool if_[];
for(int i=;i<=;i++)
{
if(ai[][i]==-&&ai[][i]==-) continue;
int k1=point(ac[i]+,cnt,ai[][i]);
int k2=point(ac[i],cnt,ai[][i]);
int g1=point(ac[i]+,cnt,ai[][i]);
int g2=point(ac[i],cnt,ai[][i]);
if(ai[][i]==-)
{
sco2+=g2;
continue;
}
if(ai[][i]==-)
{
sco1+=k2;
continue;
}
if(ai[][i]<ai[][i])
{
sco1+=k2;
sco2+=g2;
}
else
{
ac[i]++;
sco1+=k1;
sco2+=g1;
}
}
last1=sco1,last2=sco2;
if(last1>last2)
{
cout<<cnt-n;
return ;
}
}
cout<<-;
return ;
}
AC日记——Dynamic Problem Scoring codeforces 807d的更多相关文章
- 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 #412 Div. 2 补题 D. Dynamic Problem Scoring
D. Dynamic Problem Scoring time limit per test 2 seconds memory limit per test 256 megabytes input s ...
- 【codeforces 807D】Dynamic Problem Scoring
[题目链接]:http://codeforces.com/contest/807/problem/D [题意] 给出n个人的比赛信息; 5道题 每道题,或是没被解决->用-1表示; 或者给出解题 ...
- codeforces 807 D. Dynamic Problem Scoring(贪心+思维)
题目链接:http://codeforces.com/contest/807/problem/D 题意:对于动态计分的 Codeforces Round ,已知每题的 score 是根据 Round ...
- AC日记——Dynamic Ranking 洛谷 P2617
Dynamic Ranking 思路: 可持久化树状数组: 代码: #include <bits/stdc++.h> using namespace std; #define maxn 1 ...
- AC日记——Sign on Fence Codeforces 484e
E. Sign on Fence time limit per test 4 seconds memory limit per test 256 megabytes input standard in ...
- AC日记——Andryusha and Socks Codeforces 780a
A. Andryusha and Socks time limit per test 2 seconds memory limit per test 256 megabytes input stand ...
- AC日记——Sagheer, the Hausmeister codeforces 812b
812B - Sagheer, the Hausmeister 思路: 搜索: 代码: #include <cstdio> #include <cstring> #includ ...
- AC日记——Sagheer and Crossroads codeforces 812a
812A - Sagheer and Crossroads 思路: 模拟: 代码: #include <cstdio> #include <cstring> #include ...
随机推荐
- 解决IIS的Server Application Error
问题描述一下: Server Application ErrorThe server has encountered an error while loading an application dur ...
- PowerShell收发TCP消息包
PowerShell收发TCP消息包 https://www.cnblogs.com/fuhj02/archive/2012/10/16/2725609.html 在上篇文章中,我们在PSNet包中创 ...
- [NOIP2002] 字串变换 宽搜+深度优化
这道题硬是让我用STL水过.......而且题解里说的什么双向宽搜,交替扩展............... 这道题反正,STL用就用吧,但是状态数可以卡到千亿级别,因为这个东西是阶乘扩展的,然后我们发 ...
- idea 的http client的使用
1.打开idea的http client的工具步骤如下图所示: 然后在http client 的工具里写:请求头,请求参数,请求体即可.
- 初识 spl_autoload_register
spl_autoload_register 一.首先我们看来自官网的定义 版本要求:php版本为5.1.2+ 说明:注册给定的函数作为__autoload的实现.即自动加载 函数参数说明: bool ...
- Java类的声明和访问介绍
1.类的声明 类本身的声明:对类的声明来说,主要包括类的访问权限声明和非访问修饰符的使用.对于一个普通的Java类(POJO)来说,主要的访问权限修饰符只有两个public和默认权限,内部类可以有pr ...
- 记录一次Nginx跳转报错的问题
错误信息如下: An error occurred. Sorry, the page you are looking for is currently unavailable. Please try ...
- 【BZOJ2227】【ZJOI2011】看电影 [组合数][质因数分解]
看电影 Time Limit: 10 Sec Memory Limit: 259 MB[Submit][Status][Discuss] Description 到了难得的假期,小白班上组织大家去看 ...
- bzoj 4999: This Problem Is Too Simple!
Description 给您一颗树,每个节点有个初始值. 现在支持以下两种操作: 1. C i x(0<=x<2^31) 表示将i节点的值改为x. 2. Q i j x(0<=x&l ...
- bzoj1833: [ZJOI2010]count 数字计数 && codevs1359 数字计数
bzoj1833 codevs1359 这道题也是道数位dp 因为0有前导0这一说卡了很久 最后发现用所有位数减1~9的位数就okay.....orzczl大爷 其他就跟51nod那道统计1出现次数一 ...