当前位置:网站首页>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<<" ";
}
}
边栏推荐
- Unity profiler performance analysis
- 力扣704. 二分查找
- 终端便捷ssh(免密)连接
- Solution to the 292 week match of Li Kou
- Unity obtains serial port data
- Unity3d realizes Google Digital Earth
- 产生 BUG 测试人员需要自己去分析原因吗?
- Network communication problem locating steps
- Unity3d packaging and publishing APK process
- Unity3d learning notes-1 (C # learning)
猜你喜欢

遥感图像/UDA:Curriculum-Style Local-to-Global Adaptation for Cross-Domain Remote Sensing Image Segmentat

虚析构和纯虚析构

Force buckle 349 Intersection of two arrays

Intellj idea jars projects containing external lib to other project reference methods - jars

Preorder traversal of Li Kou 589:n fork tree

【VCS+Verdi联合仿真】~ 以计数器为例

Unity3d packaging and publishing APK process

终端便捷ssh(免密)连接

Unity screenshot method

VFPBS在IIS下调用EXCEL遇到的Access is denied
随机推荐
Harbor API 2.0 query
Records of problems encountered in unity + hololens development
Unity Catmull ROM curve
Database base (Study & review for self use)
svg和canvas的区别
Force buckle 349 Intersection of two arrays
Pytorch的安装以及入门使用
Display steerable 3D model in front of unity UI
PWN Introduction (2) stack overflow Foundation
Leetcode 180 Consecutive numbers (2022.06.29)
[learning notes] AssetBundle, xlua, hot update (use steps)
Unity multiple UI page turning left and right
Win10 vs2015 compiling curaengine
Bessel curve with n control points
Unity download and installation website
Unity2019.3.8f1 development environment configuration of hololens2
Rotation, translation and scaling of unity VR objects
Golan no tests were run: fmt Printf() &lt; BUG&gt;
Pycharm database tool
Chinese pycharm changed to English pycharm