Dynamic Problem Scoring

思路:

  水题;

代码:

#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的更多相关文章

  1. 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 ...

  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 ...

  3. 【codeforces 807D】Dynamic Problem Scoring

    [题目链接]:http://codeforces.com/contest/807/problem/D [题意] 给出n个人的比赛信息; 5道题 每道题,或是没被解决->用-1表示; 或者给出解题 ...

  4. codeforces 807 D. Dynamic Problem Scoring(贪心+思维)

    题目链接:http://codeforces.com/contest/807/problem/D 题意:对于动态计分的 Codeforces Round ,已知每题的 score 是根据 Round ...

  5. AC日记——Dynamic Ranking 洛谷 P2617

    Dynamic Ranking 思路: 可持久化树状数组: 代码: #include <bits/stdc++.h> using namespace std; #define maxn 1 ...

  6. 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 ...

  7. AC日记——Andryusha and Socks Codeforces 780a

    A. Andryusha and Socks time limit per test 2 seconds memory limit per test 256 megabytes input stand ...

  8. AC日记——Sagheer, the Hausmeister codeforces 812b

    812B - Sagheer, the Hausmeister 思路: 搜索: 代码: #include <cstdio> #include <cstring> #includ ...

  9. AC日记——Sagheer and Crossroads codeforces 812a

    812A - Sagheer and Crossroads 思路: 模拟: 代码: #include <cstdio> #include <cstring> #include ...

随机推荐

  1. java05笔记

  2. 【历史】- .NET之父 - Anders Hejlsberg

    简介 安德斯·海尔斯伯格(Anders Hejlsberg,1960.12~),丹麦人,Turbo Pascal编译器的主要作者,Delphi和.NET之父! 安德斯·海尔斯伯格曾在丹麦技术大学学习工 ...

  3. 如何写出规范的JavaScript代码

    作为一名开发人员(WEB前端JavaScript开发),不规范的开发不仅使日后代码维护变的困难,同时也不利于团队的合作,通常还会带来代码安全以及执行效率上的问题.本人在开发工作中就曾与不按规范来开发的 ...

  4. 如何抓取开了gzip的网页

    有时候用 file_get_contents() 函数抓取网页会发生乱码现象.有两个原因会导致乱码,一个是编码问题,一个是目标页面开了Gzip. 编码问题好办,把抓取到的内容转下编码即可($conte ...

  5. BZOJ1202:狡猾的商人(带权并查集)

    1202: [HNOI2005]狡猾的商人 题目链接:https://www.lydsy.com/JudgeOnline/problem.php?id=1202 Description: 刁姹接到一个 ...

  6. 状压DP初识~~炮兵阵地

    炮兵阵地 Time Limit: 2000MS   Memory Limit: 65536K Total Submissions: 31718   Accepted: 12253 Descriptio ...

  7. vue文件使用stylus报错问题

    先npm install stylus --save然后安装你少的page.json中依赖:npm install stylus-loader css-loader style-loader --sa ...

  8. c++ STL(2)

    Vector: #include "stdafx.h" #include<iostream> #include<vector> #include<al ...

  9. css之postion定位

    css position之初识 我们先看看position定位有那几个属性,下面是我从w3c的截图,为我们认识定位做初步的了解 通过上面这张图嘞,我们知道了position有5个属性,那么下面,我就来 ...

  10. 解析 Array.prototype.slice.call(arguments,0)

    Array.prototype.slice.call(arguments,0) 经常会看到这段代码用来处理函数的参数 网上很多复制粘帖说:Array.prototype.slice.call(argu ...