set会自动去重和排序
- #include
- using namespace std;
- map
int>> name_c; - int main(){
- int n,k;
- cin>>n>>k;//n个学生,k个课程 1-k
- int idx=1;
- for(int i=0;i
- int course_id,stu_ct;
- cin>>course_id>>stu_ct;
- for(int j=0;j
- string stu_name;
- cin>>stu_name;
- name_c[stu_name].insert(course_id);
- }
- }
- for(int i=0;i
- string name;
- cin>>name;
- cout<
" "; - cout<
size(); - for(auto& x:name_c[name]){
- cout<<" "<
- }
- cout<
- }
- return 0;
- }
-
相关阅读:
人工智能(Python)逻辑编程
欧科云链研究院:锚定金融市场,香港从STO再出发
立仪科技光谱共焦应用之金属隔膜静态重复性测量
Python学习记录 函数基础
pytest合集(14)— allure测试报告
Linux crontab定时任务设置
ChatGPT 助力英文论文翻译和润色
AutoConfigurationPackages.Registrar.class源码阅读
L53.linux命令每日一练 -- 第八章 Linux磁盘与文件系统管理命令 -- dd和mount
解决IntelliJ IDEA执行maven打包,执行java -jar命令提示jar中没有主清单属性
-
原文地址:https://blog.csdn.net/weixin_52030057/article/details/132986572