当前位置:网站首页>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;
}边栏推荐
- laravel8 实现接口鉴权封装使用JWT
- Implementation of distributed lock
- Constructing verb sources for relation extraction
- Introduction to UFS CLK gate
- STM32状态机编程实例——全自动洗衣机(下)
- Dat of deep learning
- Redis如何实现持久化?详细讲解AOF触发机制及其优缺点,带你快速掌握AOF
- 2022 Hangzhou Electric Multi school bowcraft
- Save the image with gaussdb (for redis), and the recommended business can easily reduce the cost by 60%
- ZK snark: about private key, ring signature, zkksp
猜你喜欢

1311_ Hardware design_ Summary of ICT concept, application, advantages and disadvantages

General test case writing specification

Connect external MySQL databases in istio Service Grid

Leetcode: 102. Sequence traversal of binary tree

ZK snark: about private key, ring signature, zkksp

PHP method to find the location of session storage file

加班一周开发了报表系统,这个低代码免费IT报表神器太好用了

Overview of wavelet packet transform methods

Summary of senior report development experience: understand this and do not make bad reports

Opencv learning notes - remapping
随机推荐
How does redis implement persistence? Explain the AOF trigger mechanism and its advantages and disadvantages in detail, and take you to quickly master AOF
5年1.4W倍,NFT OG 的封神之路|Web3专栏
ZK snark: about private key, ring signature, zkksp
Failed to install the hcmon driver
KBPC1510-ASEMI大芯片15A整流桥KBPC1510
Luoda development - audio stream processing - AAC / loopbacktest as an example
Operator new, operator delete supplementary handouts
Chinese database oceanbase was selected into the Forrester translational data platform report
Oracle 11g "password delayed verification" feature
Communication protocol and message format between microservices
《opencv学习笔记》-- 霍夫变换
2.9.4 Boolean object type processing and convenient methods of ext JS
按键消抖的Verilog实现
UFS Clk Gate介绍
Kbpc1510-asemi large chip 15A rectifier bridge kbpc1510
php 查找 session 存储文件位置的方法
Synchronous FIFO based on shift register
Supervit for deep learning
2022杭电多校 Bowcraft
CPU and GPU are out of date, and the era of NPU and APU begins
https://github.com/ZouJiu1/PAT