Condorcet Winners
来源:互联网 发布:html5动画源码怎么用 编辑:程序博客网 时间:2024/05/17 18:48
看大神的代码后才会做
打擂台相似的想法
#include <stdio.h>#include <stdlib.h>#include <math.h>#include <string.h>#include <iostream>#include <algorithm>#include <vector>#include <map>using namespace std;int n,m;int people[512][2512];int compare(int a,int b){ int c1=0; int c2=0; for(int i=0;i<n;i++) if(people[i][a]<people[i][b]) c1++; else c2++; return c1-c2;}int cas=1;int main(){ int i,j; while(scanf("%d%d",&n,&m),n|m) { int a,b; for( i=0;i<n;i++) { for( j=0;j<m;j++) { scanf("%d",&a); people[i][a]=j; } } int win=0; for( i=1;i<m;i++) { if(compare(win,i)<=0) win=i; } for( i=0;i<m;i++) if(i!=win) { if(compare(win,i)<=0) break; } if(i==m) printf("Case %d: %d\n",cas++, win); else printf("Case %d: No Condorcet winner\n",cas++); }}
- Condorcet Winners
- [模拟] hnu 12475 Condorcet Winners
- uestc oj 1868 Condorcet Winners
- Condorcet method
- Intrinsity Acquisition: Winners and Losers
- 2006 Java Technology Winners and Losers
- Web 2.0 Winners for MAY 9, 2008
- 2010 LinuxQuestions.org Members Choice Award Winners
- Developer.com Product of the Year 2005 Winners
- The Winners of the 18th Jolt Product Excellence Awards
- The Winners of the 18th Jolt Product Excellence Awards
- 2009 ACM International Collegiate Programming Contest Winners Announced
- 2006-2008 Open Source CMS Award Previous Winners
- Inside Market Data Award Winners 2010 - Vendor Categories
- 2015 Small Business Book Awards Community Choice Winners
- Light OJ 1327 Help the Winners (状压DP)
- 2012年及之后的ImageNet比赛的冠军、亚军和季军ImageNet winners after 2012
- CMP Media’s Software Development Magazine Announces Winners for the 15th Annual Jolt Product Excellence & Productivity Awards
- 一个合格的程序员应该读过哪些书
- ios实现通讯录的查询与删除
- SQL SERVER2008开启远程数据库访问
- android HttpURLConnection 连接网络 读取返回数据
- eclipse android开发 之 项目结构
- Condorcet Winners
- VIM 文件操作集锦
- Oracle学习查询语句的笔记
- UITextField 左图以及文字位置的设置
- Android—Animation
- 《VC++深入详解》学习笔记 第二章 掌握C++
- dtree动态树+Javascript右键菜单
- Android接口定义语言---AIDL(三)
- js对table执行增-删-改