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 ...
随机推荐
- Hibernate关联映射之_一对一
数据库模型 一般对一对一的关系而言,会存在一个主从关系.如 人 与 身份证,就是一个一对一关系, 人 是主,身份证 是从 Person PK:id name age Id_Card PK.FK:id ...
- 在程序内部跳转到下一个页面 和 向另一个servlet发起跳转
request.getRequestDispatcher("/success.html").forward(request,response); request.getReques ...
- 变量可以通过into赋值
- [Leetcode] Convert sorted list to binary search tree 将排好的链表转成二叉搜索树
---恢复内容开始--- Given a singly linked list where elements are sorted in ascending order, convert it to ...
- 洛谷 P1415 拆分数列 解题报告
拆分数列 题目背景 [为了响应党中央勤节俭.反铺张的精神,题目背景描述故事部分略去^-^] 题目描述 给出一列数字,需要你添加任意多个逗号将其拆成若干个严格递增的数. 如果有多组解,则输出使得最后一个 ...
- 关于label标签的作用
label标签的定义和用法: <label> 标签为 input 元素定义标注(标记). label 元素不会向用户呈现任何特殊效果.不过,它为鼠标用户改进了可用性.如果您在 label ...
- redux-saga基本用法
redux-saga是管理redux异步操作的中间件,redux-saga通过创建sagas将所有异步操作逻辑收集在一个地方集中处理. sagas采用Generator函数来yield Effects ...
- Codeforces Round #531 (Div. 3) ABCDEF题解
Codeforces Round #531 (Div. 3) 题目总链接:https://codeforces.com/contest/1102 A. Integer Sequence Dividin ...
- E. Intercity Travelling
E. Intercity Travelling time limit per test 1.5 seconds memory limit per test 256 megabytes input st ...
- 证明spring中<property name="">这个双引号的内容只与setter方法有关,与一个类定义的字段和getter方法无关
证明如下: 思路定义两个实体类每个实体类的成员变量(字段)名和setter 和getter的名字都不一样: 原因是:bean的声明周期的原因:有一步是:注入属性. 其中一个类引用了另一个类. 被引用类 ...