POJ-2028
来源:互联网 发布:日本人的交友软件 编辑:程序博客网 时间:2024/06/06 03:46
#include<iostream>#include<map>#include<utility>using namespace std;int main(int argc, char *argv[]){int n,q;while(cin>>n>>q,n!=0 || q!=0){map<int,int> date;map<int,int>::iterator pos=date.begin();for(int i=0;i<n;i++){int m;cin>>m;for(int j=0;j<m;j++){int mj;cin>>mj;pos=date.find(mj);if(pos==date.end()){date.insert(pair<int,int>(mj,1));}else{pos->second++;}}}int cd=-1;for(map<int,int>::iterator iter=date.begin();iter!=date.end();++iter){if(iter->second>cd){pos=iter;cd=iter->second;}}int result;if(pos->second>=q){result=pos->first;}else{result=0;}cout<<result<<endl;}return 0;}
0 0
- POJ 2028
- poj-2028
- POJ-2028
- POJ
- poj
- POJ
- POJ
- poj
- poj
- POJ
- POJ
- poj
- POJ
- POJ
- POJ
- POJ
- POJ
- POJ
- android--(BroadcastReceiver)
- 十二、机器学习系统设计笔记之大数据
- 欢迎使用CSDN-markdown编辑器
- 批处理文件 bat 的入门命令
- LintCode:二叉树的最小深度
- POJ-2028
- Brackets(区间DP)
- Repo和Git 版本管理常用命令
- [sicily]1150. 简单魔板
- linux 获取 CPU 使用信息
- 绘制虚线
- Mysql的下载和安装
- poj 1873 final 水题 位枚举凸包
- 天声人語 20151011 ゴリラに会いに行く