当前位置:网站首页>【暑期每日一题】洛谷 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;
}
边栏推荐
- How to use common datasets in pytorch
- How do I sort a list of strings in dart- How can I sort a list of strings in Dart?
- 分布式事务-解决方案
- Registration for R2 mobile pressure vessel filling test in 2022 and R2 mobile pressure vessel filling free test questions
- 常用的Transforms中的方法
- STM32扩展板 数码管显示
- C -- array
- 对象的序列化与反序列化
- [godot] unity's animator is different from Godot's animplayer
- Advanced application of ES6 modular and asynchronous programming
猜你喜欢
测量三相永磁同步电机的交轴直轴电感
数据加载及预处理
I also gave you the MySQL interview questions of Boda factory. If you need to come in and take your own
Use of dataloader
Shell之一键自动部署Redis任意版本
RuntimeError: “max_pool2d“ not implemented for ‘Long‘
Neural network convolution layer
先有网络模型的使用及修改
分布式-总结列表
Research on medical knowledge atlas question answering system (I)
随机推荐
CF1638E. Colorful operations Kodori tree + differential tree array
LeetCode_ 28 (implement strstr())
分布式锁的实现
Openresty rewrites the location of 302
LeetCode_35(搜索插入位置)
技术分享| 融合调度中的广播功能设计
Summary of acl2021 information extraction related papers
LeetCode_66(加一)
Kodori tree board
Announcement on the list of Guangdong famous high-tech products to be selected in 2021
Leecode record 1351 negative numbers in statistical ordered matrix
Common UNIX Operation and maintenance commands of shell
Extension fragment
Solve the problem that the external chain file of Qiankun sub application cannot be obtained
LM小型可编程控制器软件(基于CoDeSys)笔记十九:报错does not match the profile of the target
AssertionError assert I.ndim == 4 and I.shape[1] == 3
How do I sort a list of strings in dart- How can I sort a list of strings in Dart?
2022 a special equipment related management (elevator) simulation test and a special equipment related management (elevator) certificate examination
测量三相永磁同步电机的交轴直轴电感
LeetCode_ 58 (length of last word)