当前位置:网站首页>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;
}边栏推荐
- Opencv learning notes -- Hough transform
- PHP implements the algorithm of adding from 1 to 100
- Data elements
- 安装VMware报错failed to install the hcmon driver
- If you want to do a good job in software testing, you can first understand ast, SCA and penetration testing
- PHP 对象转换数组
- php 实现从1累加到100的算法
- Educational Codeforces Round 132 (Rated for Div. 2) E. XOR Tree
- PHP <=> 太空船运算符(组合比较符)
- ASEMI整流桥GBU1510参数,GBU1510规格,GBU1510封装
猜你喜欢

基于移位寄存器的同步FIFO

Six years of automated testing from scratch, I don't regret turning development to testing

CPU and GPU are out of date, and the era of NPU and APU begins

深度学习之SuperViT

Chapter 18: explore the wonders of the mean in the 2-bit a~b system, specify the 3x+1 conversion process of integers, specify an interval to verify the angular Valley conjecture, explore the number of

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

MySQL索引失效场景以及解决方案

Opencv learning notes - edge detection and Canny operator, Sobel operator, lapiacian operator, ScHARR filter

在 Istio 服务网格内连接外部 MySQL 数据库

Acwing第 61 场周赛【完结】
随机推荐
1311_硬件设计_ICT概念、应用以及优缺点学习小结
Operator new, operator delete supplementary handouts
Linear basis property function code to achieve 3000 words detailed explanation, with examples
Asemi rectifier bridge gbu1510 parameters, gbu1510 specifications, gbu1510 package
php 查找 session 存储文件位置的方法
One stop monitoring of the software and hardware infrastructure of the whole university, and Suzhou University replaces PostgreSQL with time series database
按键消抖的Verilog实现
[MCU simulation project] external interrupt 0 and 1 control two digit nixie tube to count
Supervit for deep learning
Experimental reproduction of image classification (reasoning only) based on caffe resnet-50 network
Chinese database oceanbase was selected into the Forrester translational data platform report
Analysis on the infectious problem of open source license
ZK snark: about private key, ring signature, zkksp
Realization of online shopping mall system based on JSP
[Reading Notes - > data analysis] Introduction to BDA textbook data analysis
Maximum average value of continuous interval
2021 CIKM |GF-VAE: A Flow-based Variational Autoencoder for Molecule Generation
【读书笔记->数据分析】01 数据分析导论
JS Base64 encoding and decoding
laravel8 实现接口鉴权封装使用JWT
https://github.com/ZouJiu1/PAT