HDU 4194 Peer Review

原创 2016年11月09日 11:04:05

Description

For scienti c conferences, scientists submit papers presenting their ideas, and then review each other's papers to make sure only good papers are presented at the conference. Each paper must be reviewed by several scientists, and scientists must not review papers written by people they collaborate with (including themselves), or review the same paper more than once. 
 You have been asked to write a program to check if your favorite conference is doing things right. Whether a paper is being reviewed too much, too little, or by the wrong people - the organizers must know before it is too late!

Input

The fi rst line in each test case has two integers, K (1<=K<=5) and N (1<=N<=1000). K is the number of reviews that each paper will receive, while N is the number of papers to be reviewed. The conference only accepts papers with a single author, and authors can only present a single paper at the conference. 
 Each of the next N lines describes an author and includes the name of the institution to which the author belongs, followed by the list of the K papers he or she has been requested to review. It is assumed that researchers from the same institution collaborate with each other, where as researchers from diff erent institutions don't. All institution names are shorter than 10 characters, and contain only upper or lowercase letters and no whitespace. Since we have as many papers as authors, papers are identi ed by their author's index; paper 1 was written by the first author in the list, and paper N was written by the last author. 
 The end of the test cases is marked with a line containing K = 0 and N = 0. You should generate no output for this line.

Output

For each test case, your program should output NO PROBLEMS FOUND (if all rules are being followed) or P PROBLEMS FOUND, where P is the number of rule violations found (counting at most 1 violation per paper). If there is exactly one rule violation overall, your program should output 1 PROBLEM FOUND.

Sample Input

2 3
UCM 2 3
UAM 1 3
UPM 1 2
2 3
UCM 2 3
UAM 1 2
UPM 2 2
0 0

Sample Output

NO PROBLEMS FOUND

3 PROBLEMS FOUND

读懂题目就是水题。

#include<set>
#include<map>
#include<ctime>
#include<cmath>
#include<stack>
#include<queue>
#include<bitset>
#include<cstdio>
#include<string>
#include<cstring>
#include<iostream>
#include<algorithm>
#include<functional>
#define rep(i,j,k) for (int i = j; i <= k; i++)
#define per(i,j,k) for (int i = j; i >= k; i--)
#define loop(i,j,k) for (int i = j;i != -1; i = k[i])
#define lson x << 1, l, mid
#define rson x << 1 | 1, mid + 1, r
#define ff first
#define ss second
#define mp(i,j) make_pair(i,j)
#define pb push_back
#define pii pair<int,LL>
#define inone(x) scanf("%d", &x)
#define intwo(x,y) scanf("%d%d", &x, &y)
using namespace std;
const int N = 1e3+5;
const int mod=1e9+7;
int n, m, a[N][10],f[N],c[N];
string s[N];

int main()
{
    while(intwo(m,n),n+m)
    {
        rep(i,1,n) f[i]=c[i]=0;
        rep(i,1,n)
        {
            cin>>s[i];
            rep(j,0,m-1) inone(a[i][j]);
        }
        rep(i,1,n)
        {
            sort(a[i],a[i]+m);
            rep(j,0,m-1)
            {
                if(j&&a[i][j]==a[i][j-1]) f[a[i][j]]=1;
                if (s[a[i][j]]==s[i]) f[a[i][j]]=1;
                else c[a[i][j]]++;
            }
        }
        int ans=0;
        rep(i,1,n) ans+=f[i]|(c[i]!=m);
        if (ans>1) printf("%d PROBLEMS FOUND\n",ans);
        else if (ans==1) printf("%d PROBLEM FOUND\n",ans);
        else printf("NO PROBLEMS FOUND\n");
    }
    return 0;
}


版权声明:本文为博主原创文章,未经博主允许不得转载。

几种peer review的比较

A case study of Apache peer review分析了Apache项目的代码检查过程,提出了两种Apache所使用的代码检查流程:    * Commit-Then-Review ...
  • jq0123
  • jq0123
  • 2007年08月02日 13:35
  • 1205

ORA-00600: 内部错误代码, 参数: [4194], [24], [22], [], [], [], [], []

由于电脑经常非法关机,导致数据关闭时,出现以下错误。 Errors in file c:\oracle\product\10.1.0\admin\orcl\bdump\orcl_smon_5140....
  • warden2010
  • warden2010
  • 2011年11月24日 21:42
  • 2740

ORA-00600 [4194]的解决

今天遇到一个standby 拷贝出来的库要
  • xionglang7
  • xionglang7
  • 2014年05月09日 16:55
  • 2910

软件开发管理:代码互审(code peer review)

代码互审互查,是非常有效,第一重要的代码质量管理方法。另一个重要方法是代码自动测试。代码互审来得比自动测试更为重要,这是因为自动测试不一定适用于所有的项目;代码互审可发现设计缺陷和后门代码,而且让团队...
  • lxguru2
  • lxguru2
  • 2016年01月27日 04:46
  • 335

Peer Review 浅析

Peer Review(070620 den198@hotmail.com 李宁)PR的概念和目的    Peer Review又名同级评审或一对一评审,同级评审的目的是为了要检查工作的内容,尽早的找...
  • menox
  • menox
  • 2007年09月12日 15:18
  • 815

What is Review Efficiency, peer review ,Verification and Validation

 1;What is Review EfficiencyThis metric shows the efficiency of the review process. A higher ratio o...
  • xiagaoming
  • xiagaoming
  • 2006年11月02日 17:45
  • 487

ORA-600[4194]/[4193]解决

朋友的库启动的时候出现ORA-600[4194]/[4193]错误 Tue Feb 14 09:34:11 2012 Errors in file ...
  • liqfyiyi
  • liqfyiyi
  • 2014年09月18日 12:21
  • 1763

UVA12394/HDU4194 Peer Review 模拟

http://acm.hdu.edu.cn/showproblem.php?pid=4194 题目大意:就是一道英文题,题意很纠结。输入一个K和N,K是没人审核的paper数和每个paper必须...
  • xfeifeix
  • xfeifeix
  • 2012年08月04日 20:18
  • 399

Oracle Ora-00600 4194错误的解决方法

  问题:我的数据库重新启动后,出现了Ora-00600 4194错误,具体的日志如下:  Sat Jan 21 13:55:21 2006  Errors in file /opt/oracle/a...
  • wangshengfeng1986211
  • wangshengfeng1986211
  • 2010年12月06日 14:55
  • 380

Peer Review 该如何翻译

 Review这个词意思很明确,就是“再看看”,但是在中国表示看的词太多了,结果“Peer Review”反而不太好翻译。保持英文原文,或者翻译一半成“同级review”,都是意思比较精确的。评审, ...
  • jq0123
  • jq0123
  • 2007年08月02日 10:25
  • 7703
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:HDU 4194 Peer Review
举报原因:
原因补充:

(最多只允许输入30个字)