当前位置:网站首页>E: Topic focus
E: Topic focus
2022-06-30 05:14:00 【Catci】
E: The focus of the topic
Total time limit : 1000ms Memory limit : 65536kB
describe
Microblog provides a convenient communication platform . In a micro blog , Other users can be mentioned . for example Lee Send a microblog as :“ The final exam went well @Kim @Neo”, be Lee Mentioned Kim and Neo Two users .
We have collected N(1 < N < 10000) Micro-blog , And the user name has been extracted , Use less than or equal to 100 Positive integer representation of .
By analyzing these data , We hope to find the focus of everyone's topic , That is, the most mentioned people ( The title guarantees that there is only one such person ), And find out who mentioned it .
Input
The input consists of two parts :
The first part is the number of microblogs N,1 < N < 10000.
The second part is N Micro-blog , Each microblog occupies one line , Expressed as :
Sender serial number a, Number of persons mentioned k(0 < = k < = 20), And then there was k Serial number of mentioned persons b1,b2…bk;
among a and b1,b2…bk Are greater than 0 Less than or equal to 100 The integer of . Two adjacent integers are separated by a single space .
Output
The output is divided into two lines :
The first line is the serial number of the most mentioned people ;
The second line is the serial number of the person who mentioned it , From small to large output , Two adjacent numbers are separated by a single space . The same serial number is output only once .
The sample input
5
1 2 3 4
1 0
90 3 1 2 4
4 2 3 2
2 1 3
Sample output
3
1 2 4
source
Introduction to computing in the Department of medicine 2011 The final exam ( Xiejialiang )
Code
// 20: The focus of the topic
#include <bits/stdc++.h>
using namespace std;
struct Man{
int mentioned = 0;
int v[102] = {
0};
} man[102];
int main(){
int n,v;
cin>>n;
for(int i = 0;i < n;i++){
cin>>v>>k;
for(int j = 0;j < k;j++){
cin>>b;
man[b].sum++;
man[b].v[v]=1;
}
}
int max=0,index=0;
for(int i = 0;i < 102;i++){
index = man[i].mentioned > max?i:index;
}
cout<<index<<endl;
for(int i = 0;i < 102;i++){
if(man[index].v[i]) cout<<i<<" ";
}
}
边栏推荐
- Intellj idea jars projects containing external lib to other project reference methods - jars
- Unity project hosting platform plasticscm (learn to use 2)
- 【VCS+Verdi聯合仿真】~ 以計數器為例
- Unity3d realizes Google Digital Earth
- Unrealeengine4 - about uobject's giant pit that is automatically GC garbage collected
- Unity download and installation website
- 003-JS-DOM-Attr-innerText
- Tcp/ip protocol details Volume I (Reading Guide)
- The file has been downloaded incorrectly!
- Chinese pycharm changed to English pycharm
猜你喜欢

Writing unityshader with sublimetext

pycharm 数据库工具

Records of some problems encountered during unity development (continuously updated)

力扣704. 二分查找
![[notes] unity webgl input Chinese](/img/f7/805f510ff691227b4c2b529cc1099a.jpg)
[notes] unity webgl input Chinese

Unity publishing /build settings

LXC 和 LXD 容器总结

Records of problems encountered in unity + hololens development

PWN入门(2)栈溢出基础

Parkour demo
随机推荐
Unity camera control
Oracle-数据的基本操作
Records of problems encountered in unity + hololens development
Intellj idea generates jar packages for projects containing external lib to other projects. The method refers to the jar package written by itself
LXC 和 LXD 容器总结
Untiy3d controls scene screenshots through external JSON files
mmdet之Loss模块详解
003-JS-DOM-Attr-innerText
遥感图像/UDA:Curriculum-Style Local-to-Global Adaptation for Cross-Domain Remote Sensing Image Segmentat
【VCS+Verdi聯合仿真】~ 以計數器為例
Operation file file class method
How does unity use mapbox to implement real maps in games?
Singleton mode in unity
Unity determines whether the UI is clicked
2021-07-29 compilation of Cura in ubantu18.04
GoLand No Tests Were Run : 不能使用 fmt.Printf() &lt;BUG&gt;
Golan no tests were run: fmt Printf() &lt; BUG&gt;
Nestjs入门和环境搭建
Writing unityshader with sublimetext
PWN入门(2)栈溢出基础