当前位置:网站首页>Pat class a 1039 course list for student
Pat class a 1039 course list for student
2022-07-26 04:04:00 【IX. is it a non random title】
#include<iostream>
#include<vector>
#include<string>
#include<bits/stdc++.h>
using namespace std;
int main(void){
int i, j, k, m, n, h, mm, nn;
int numstd, numcor;
set<string> vec[2600];
cin>>m>>n;
string s;
int max = -999;
for(i = 0 ; i < n; i++)
{
cin>>mm>>nn;
for(j = 0; j < nn; j++){
cin>>s;
vec[mm].insert(s);
}
if(mm>max) max = mm;
}
vector<string> vs;
for(i = 0; i < m; i++){
cin>>s;
vs.push_back(s);
}
set<string>::iterator it;
set<string> ste;
for(i = 0; i<vs.size(); i++){
s = vs[i];
vector<int> vtr;
for(j = 1; j<=max; j++){
ste = vec[j];
if(ste.size()==0) continue;
it = ste.find(s);
if(it!=ste.end()){
vtr.push_back(j);
}
}
sort(vtr.begin(), vtr.end());
cout<<s<<" "<<vtr.size();
for(j = 0; j<vtr.size();j++){
if(j==0) cout<<" ";
cout<<vtr[j];
if(j != (vtr.size() - 1)) cout<<" ";
}
cout<<endl;
}
return 0;
}边栏推荐
- How to use graffiti magic color product development kit
- Introduction to UFS CLK gate
- booking.com缤客上海面经
- 深度学习之DAT
- php 保存数组到文件 var_export、serialize
- Leetcode: 102. Sequence traversal of binary tree
- [cloud native] talk about the understanding of the old message middleware ActiveMQ
- WAF details
- 【读书笔记->数据分析】01 数据分析导论
- Educational Codeforces Round 132 (Rated for Div. 2) E. XOR Tree
猜你喜欢

PHP method to find the location of session storage file

深度学习之DAT

What is the problem of the time series database that has been developed for 5 years?

Go Plus Security:一款Build Web3不可或缺的安全生态基础设施

ZK snark: about private key, ring signature, zkksp

工程师如何对待开源 --- 一个老工程师的肺腑之言

Mantium 如何在 Amazon SageMaker 上使用 DeepSpeed 实现低延迟 GPT-J 推理

(翻译)按钮位置约定能强化用户使用习惯

如何构建面向海量数据、高实时要求的企业级OLAP数据引擎?

触觉智能分享-RK3568在景区导览机器人中的应用
随机推荐
2022杭电多校 Bowcraft
Realization of online shopping mall system based on JSP
General test case writing specification
[MCU simulation project] external interrupt 0 and 1 control two digit nixie tube to count
按键消抖的Verilog实现
电商运营小白,如何快速入门学习数据分析?
Maximum average value of continuous interval
Mantium 如何在 Amazon SageMaker 上使用 DeepSpeed 实现低延迟 GPT-J 推理
Basic principles of iptables
[digital ic/fpga] Hot unique code detection
[in depth study of 4g/5g/6g topic-42]: urllc-13 - in depth interpretation of 3GPP urllc related protocols, specifications and technical principles -7-low delay technology-1-subcarrier spacing expansio
ZK snark: about private key, ring signature, zkksp
深度学习之SuperViT
[深入研究4G/5G/6G专题-42]: URLLC-13-《3GPP URLLC相关协议、规范、技术原理深度解读》-7-低延时技术-1-子载波间隔扩展
Seat / safety configuration upgrade is the administrative experience of the new Volvo S90 in place
工程师如何对待开源 --- 一个老工程师的肺腑之言
SDL2 Opengl遇到的坑
2021 CIKM |GF-VAE: A Flow-based Variational Autoencoder for Molecule Generation
Lua and go mixed call debugging records support cross platform (implemented through C and luajit)
Advanced content of MySQL -- three MySQL logs that must be understood binlog, redo log and undo log
https://github.com/ZouJiu1/PAT