当前位置:网站首页>【暑期每日一题】洛谷 P5886 Hello, 2020!
【暑期每日一题】洛谷 P5886 Hello, 2020!
2022-07-01 04:47:00 【AC_Dragon】
题目链接:P5886 Hello, 2020! - 洛谷 | 计算机科学教育新生态 (luogu.com.cn)
题目背景
时针与分针重合在「零」的那一霎那,嘀嗒声便宣告了新一年的到来。
在过去的一年里,世事无常。屏幕面前的你可能不久前才听闻「OI」,也可能暂时地结束了竞赛生涯;可能在赛场上叱咤风云名列榜首,也可能独自承受着比赛失利的落寞。
无论如何,过去仍旧是过去,将来依然是将来。
以此题为开端,迎接你的 2020 吧!
题目描述

输入格式

输出格式

样例 #1
样例输入 #1
4 3 2
2 2 3
1 1
3 1 2 3
2 1 3样例输出 #1
1
2提示

AC code:
#include<iostream>
#include<algorithm>
#include<vector>
using namespace std;
const int N = 1e6+10;
int a[N];
int main()
{
int n,m,p;
cin>>n>>m>>p;
while(n--)
{
int t;
cin>>t;
while(t--)
{
int x;
cin>>x;
a[x]++;
}
}
vector<int> res;
for(int i=1;i<=m;i++) // 注意此时范围必须为 1~m ,否则测试点无法通过!!!
if(a[i]==p)
res.push_back(i);
// sort(res.begin(),res.end()); // 在放入res容器时已经是按照序号从小到大放入,因此无需再进行排序。
cout<<res.size()<<endl;
for(int i:res)
cout<<i<<" "; // 注意输出格式!!!
return 0;
}边栏推荐
- Difference between cookie and session
- LM小型可编程控制器软件(基于CoDeSys)笔记二十:plc通过驱动器控制步进电机
- [FTP] the solution to "227 entering passive mode" during FTP connection
- Maixll dock quick start
- LeetCode_58(最后一个单词的长度)
- Use of dataloader
- 2022.2.7-2.13 AI industry weekly (issue 84): family responsibilities
- Some tools that research dogs may need
- Registration for R2 mobile pressure vessel filling test in 2022 and R2 mobile pressure vessel filling free test questions
- LeetCode_ 58 (length of last word)
猜你喜欢

Fitness without equipment

Kodori tree board

Pytorch(四) —— 可视化工具 Visdom

【硬十宝典】——2.【基础知识】开关电源各种拓扑结构的特点

Neural networks - use of maximum pooling

2022 G2 power station boiler stoker examination question bank and G2 power station boiler stoker simulation examination question bank

How to use common datasets in pytorch

Sorting out 49 reports of knowledge map industry conference | AI sees the future with wisdom

STM32 extended key scan

无器械健身
随机推荐
Common methods in transforms
Common UNIX Operation and maintenance commands of shell
【硬十宝典】——1.【基础知识】电源的分类
先有网络模型的使用及修改
Registration of P cylinder filling examination in 2022 and analysis of P cylinder filling
VR线上展览所具备应用及特色
2022 Shanghai safety officer C certificate examination question simulation examination question bank and answers
JS to solve the problem of floating point multiplication precision loss
STM32扩展板 温度传感器和温湿度传感器的使用
Neural network - nonlinear activation
[pat (basic level) practice] - [simple simulation] 1064 friends
AssertionError assert I.ndim == 4 and I.shape[1] == 3
Sorting out 49 reports of knowledge map industry conference | AI sees the future with wisdom
Caijing 365 stock internal reference | the first IPO of Beijing stock exchange; the subsidiary of the recommended securities firm for gambling and gambling, with a 40% discount
2022 t elevator repair new version test questions and t elevator repair simulation test question bank
Shell analysis server log command collection
神经网络-使用Sequential搭建神经网络
Measurement of quadrature axis and direct axis inductance of three-phase permanent magnet synchronous motor
RDF query language SPARQL
How to view the changes and opportunities in the construction of smart cities?