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 ...
随机推荐
- Football Games(思维题)
Problem Description A mysterious country will hold a football world championships---Abnormal Cup, at ...
- 批处理中的IF详解
在CMD使用IF /?打开IF的系统帮助会发现IF有3种基本的用法! 第一种用法:IF [NOT] ERRORLEVEL number command 这种用法现在很少用了,因为它需要使用到CHOIC ...
- AJAX基本演示使用
Servlet配置 <?xml version="1.0" encoding="UTF-8"?> <web-app xmlns="h ...
- 【题解】Bzoj2125最短路
处理仙人掌 ---> 首先建立出圆方树.则如果询问的两点 \(lca\) 为圆点,直接计算即可, 若 \(lca\) 为方点,则需要额外判断是走环的哪一侧(此时与两个点在环上的相对位置有关.) ...
- [BZOJ5417] [NOI2018]你的名字
Description 小A 被选为了ION2018 的出题人,他精心准备了一道质量十分高的题目,且已经把除了题目命名以外的工作都做好了. 由于ION 已经举办了很多届,所以在题目命名上也是有规定的, ...
- [bzoj4071] [Apio2015]巴邻旁之桥
Description 一条东西走向的穆西河将巴邻旁市一分为二,分割成了区域 A 和区域 B. 每一块区域沿着河岸都建了恰好 1000000001 栋的建筑,每条岸边的建筑都从 0 编号到 10000 ...
- [51nod1482]部落信号 单调栈
~~~题面~~~ 题解: 可以发现这是一道单调栈的题目,首先来考虑数字没有重复时如何统计贡献. 因为这是一个环,而如果我们从最高的点把环断开,并把最高点放在链的最后面(顺时针移动),那么因为在最高点两 ...
- 菜单 & 工具栏 & 状态栏
MFC中ON_UPDATE_COMMAND_UI和ON_COMMAND消息区别 CCmdUI 加载状态栏 加载工具栏
- BZOJ3243 [Noi2013]向量内积 【乱搞】
题目链接 BZOJ3243 题解 模数只有\(2\)或\(3\),可以大力讨论 如果模数为\(2\),乘积结果只有\(1\)或\(0\) 如果一个向量和前面所有向量乘积都为\(1\),那么其和前面向量 ...
- [模拟赛] StopAllSounds
Description 小松鼠开心地在树之间跳跃着,突然她停了下来.因为眼前出现了一个 拿着专克超萌小松鼠的法宝----超萌游戏机的游客! 超萌游戏机之所以拥有这个名字,是因为它的屏幕是一个n × 2 ...