Zhejiang University has 40,000 students and provides 2,500 courses. Now given the registered course list of each student, you are supposed to output the student name lists of all the courses. Input Specification: Each input file contains one test case. For each case, the first line contains ...
#include<iostream>#include<stdio.h>#include<string>#include<vector>#include<algorithm>usingnamespacestd;intGetId(char*name){intid=0;for(inti=0;i<3;i++){id=id*26+(name[i]-'A');}id=id*10+(name[3]-'0');returnid;}char*GetName(intid){staticcharname[5]="AAA0";name[3]=(id%...
course[courseID].push_back(i);//将学生i加入第courseID门课中 } } //输出操作 for(inti=1;i<=k;i++){ printf("%d %d\n",i,course[i].size());//第i门课的学生数 sort(course[i].begin() ,course[i].end(),cmp);//对第i门课的学生排序 for(intj=0;j<course[i].size() ;j++){...
Zhejiang University has 40,000 students and provides 2,500 courses. Now given the registered course list of each student, you are supposed to output the student name lists of all the courses. Input Specification: Each input file contains one test case. For each case, the first line contains ...
Zhejiang University has 40,000 students and provides 2,500 courses. Now given the registered course list of each student, you are supposed to output the student name lists of all the courses.Input Specification:Each input file contains one test case. For each case, the first line contains 2...
3、对每一门课,将course[i]中的学生按姓名字典序从小到大排序,然后输出所要结果 learn && wrong: 1、使用string,最后一组数据容易超时,在这种数据量大的时候,最后使用char数组 2、vector来存放每门课程的选课学生的编号,可以有效防止所有学生选了所有课程的极端情况导致得空间超限 ...
1047 Student List for Course (25 分) Zhejiang University has 40,000 students and provides 2,500 courses. Now given the registered course list of each student, you are supposed to output the student name lists of all the courses. Input Specification: ...
1047 Student List for Course 题目大意: 与1039的要求正相反,给你每名学生的选课情况,要求分别输出每门课程选课人数以及选课学生的名字,名字要按照字典序排序。 解题思路: 比1039容易多了,由于每个人的名字唯一且顺序输入,分别用1-N标记即可。值得注意的是由于输入输出量大,只能用SCANF输入,那么就只能用二维字符...
For summer vacation (July 1st-August 31st):¥90 (Student ID card necessary) Ticket BYou can exercise as long as you like a day, seven days a week. We provide: All the facilities. Shower. Swimming. Dances with teachers.Professional coaches an hour a day to direct you. Cost:¥180 a ...
AAAAAccepted code: 1#defineHAVE_STRUCT_TIMESPEC2#include<bits/stdc++.h>3usingnamespacestd;4strings[40007];5vector<string>v[2507];6intmain(){7ios::sync_with_stdio(false);8cin.tie(NULL);9cout.tie(NULL);10intn,k;11cin>>n>>k;12for(inti=1;i<=n;++i){13cin>>s[i];14intx;15cin...