Very Simple Problem
Time Limit:2000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64u
Description
The difficulty here lies in diverse meanings of the term "simple" amongst the jury members. So, the jury uses the following procedure to reach a consensus: each member weights each proposed problem with a positive integer "complexity rating" (not necessarily different for different problems). The jury member calls "simplest" those problems that he gave the minimum complexity rating, and "hardest" those problems that he gave the maximum complexity rating.
The ratings received from all jury members are then compared, and a problem is declared as "very simple", if it was called as "simplest" by more than a half of the jury, and was called as "hardest" by nobody.
Input
Output
Sample Input
4 4
1 1 1 2
5 900 21 40
10 10 9 10
3 4 3 5
Sample Output
3
/*
题意:有n位评委,给p个选手打分,让你找出very simple的选手,有这样一个标准就是给他打最低分的评委数量超过一半,并且没有评委给他打过最低分 初步思路:模拟
*/
#include <iostream>
#include <stdio.h>
#include <string.h>
using namespace std;
int n,p;
int a[][];
int cur[];//用来标记每个选手的最低分得票 cur[i]==-1表示这个选手的过最高分,那么他的积分就不做评价
int maxn,minn;
void init(){
memset(cur,,sizeof cur);
}
int main(){
// freopen("in.txt","r",stdin);
while(scanf("%d%d",&n,&p)!=EOF){
init();
for(int i=;i<n;i++){
maxn=-;
minn=;
for(int j=;j<p;j++){
scanf("%d",&a[i][j]);
if(a[i][j]>maxn){
maxn=a[i][j];
}
if(a[i][j]<minn){
minn=a[i][j];
}
}
for(int j=;j<p;j++){
if(a[i][j]==maxn)
cur[j]=-;
else if(a[i][j]==minn){
if(cur[j]==-)
continue;
else
cur[j]++;
} }
}
// for(int i=0;i<n;i++){
// cout<<cur[i]<<" ";
// }
// cout<<endl;
bool flag=false;
for(int i=;i<n;i++){
if(cur[i]>n/){
if(flag){
printf(" %d",i+);
}else{
printf("%d",i+);
flag=true;
}
}
}
if(flag==false)
printf("");
printf("\n");
}
return ;
}
Very Simple Problem的更多相关文章
- POJ 3468 A Simple Problem with Integers(线段树 成段增减+区间求和)
A Simple Problem with Integers [题目链接]A Simple Problem with Integers [题目类型]线段树 成段增减+区间求和 &题解: 线段树 ...
- POJ 3468 A Simple Problem with Integers(线段树/区间更新)
题目链接: 传送门 A Simple Problem with Integers Time Limit: 5000MS Memory Limit: 131072K Description Yo ...
- poj 3468:A Simple Problem with Integers(线段树,区间修改求和)
A Simple Problem with Integers Time Limit: 5000MS Memory Limit: 131072K Total Submissions: 58269 ...
- ACM: A Simple Problem with Integers 解题报告-线段树
A Simple Problem with Integers Time Limit:5000MS Memory Limit:131072KB 64bit IO Format:%lld & %l ...
- poj3468 A Simple Problem with Integers (线段树区间最大值)
A Simple Problem with Integers Time Limit: 5000MS Memory Limit: 131072K Total Submissions: 92127 ...
- POJ3648 A Simple Problem with Integers(线段树之成段更新。入门题)
A Simple Problem with Integers Time Limit: 5000MS Memory Limit: 131072K Total Submissions: 53169 Acc ...
- BZOJ-3212 Pku3468 A Simple Problem with Integers 裸线段树区间维护查询
3212: Pku3468 A Simple Problem with Integers Time Limit: 1 Sec Memory Limit: 128 MB Submit: 1278 Sol ...
- POJ 3468 A Simple Problem with Integers(线段树区间更新区间查询)
A Simple Problem with Integers Time Limit: 5000MS Memory Limit: 131072K Total Submissions: 92632 ...
- A Simple Problem with Integers(树状数组HDU4267)
A Simple Problem with Integers Time Limit: 5000/1500 MS (Java/Others) Memory Limit: 32768/32768 K (J ...
- A Simple Problem with Integers
A Simple Problem with Integers Time Limit: 5000MS Memory Limit: 131072K Total Submissions: 77964 Acc ...
随机推荐
- java集合系列——Map之TreeMap介绍(九)
一.TreeMap的简介 TreeMap是一个有序的key-value集合,基于红黑树(Red-Black tree)的 NavigableMap实现.该映射根据其键的自然顺序进行排序,或者根据创建映 ...
- Day3 Python基础学习——文件操作、函数
一.文件操作 1.对文件操作流程 打开文件,得到文件句柄并赋值给一个变量 通过文件句柄对文件进行操作 关闭文件 #打开文件,读写文件,关闭文件 http://www.cnblogs.com/linha ...
- 如何科学地蹭热点:用python爬虫获取热门微博评论并进行情感分析
前言:本文主要涉及知识点包括新浪微博爬虫.python对数据库的简单读写.简单的列表数据去重.简单的自然语言处理(snowNLP模块.机器学习).适合有一定编程基础,并对python有所了解的盆友阅读 ...
- CentOS 7搭建LAMP环境(二)
前面已经讲过了CentOS 7下LAMP环境的配置过程,一台简单的WEB服务器已搭建完成,但后期在网站部署的过程中也许会碰到各种各样头疼的问题.下面我们来讲讲怎么解决这些问题,以及如何高效地管理服务器 ...
- Tensorflow卷积神经网络
卷积神经网络(Convolutional Neural Network, CNN)是一种前馈神经网络, 在计算机视觉等领域被广泛应用. 本文将简单介绍其原理并分析Tensorflow官方提供的示例. ...
- c++ 11 移动语义、std::move 左值、右值、将亡值、纯右值、右值引用
为什么要用移动语义 先看看下面的代码 // rvalue_reference.cpp : 定义控制台应用程序的入口点. // #include "stdafx.h" #includ ...
- c#枚举 获取枚举键值对、描述等
using System; using System.Collections.Generic; using System.Collections.Specialized; using System.C ...
- canvas图表详解系列(2):折线图
本章建议学习时间4小时 学习方式:详细阅读,并手动实现相关代码(如果没有canvas基础,需要先学习前面的canvas基础笔记) 学习目标:此教程将教会大家如何使用canvas绘制各种图表,详细分解步 ...
- Linux“体检”指标
* { color: #3e3e3e } body { font-family: "Helvetica Neue", Helvetica, "Hiragino Sans ...
- Android onSaveInstanceState和onRestoreInstanceState()
首先来介绍onSaveInstanceState() 和 onRestoreInstanceState() .关于这两个方法,一些朋友可能在Android开发过程中很少用到,但在有时候掌握其用法会帮我 ...