1047 Student List for Course (25分)】的更多相关文章

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:…
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 cas…
题意: 输入两个正整数N和K(N<=40000,K<=2500),接下来输入N行,每行包括一个学生的名字和所选课程的门数,接着输入每门所选课程的序号.输出每门课程有多少学生选择并按字典序输出学生的名字. AAAAAccepted code: #define HAVE_STRUCT_TIMESPEC #include<bits/stdc++.h> using namespace std; ]; vector<]; int main(){ ios::sync_with_stdio…
1047. Student List for Course (25) Zhejiang University has 40000 students and provides 2500 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…
Zhejiang University has 40000 students and provides 2500 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.…
简单题. #include<iostream> #include<cstring> #include<cmath> #include<algorithm> #include<cstdio> #include<map> #include<queue> #include<string> #include<vector> using namespace std; +; struct X { ]; vect…
一开始是建立了course[2501][40001]数组,存储每节课的学生编号然后for循环两层输出,但这样复杂度为O(2500*40000),也很明显导致最后时间超时后来发现最多40000学生,每个学生最多选20门课,那么总共也就40000*20所以直接就存储学生-课程的信息,然后排个序,按照课程从小到大,课程一样的话则按字典序然后从头扫一遍即可,复杂度O(80000)不过要注意一点,有些课可能并没有出现,所以要做个判断,输出x 0. #include <iostream> #include…
一.技术总结 首先题目要看清湖,提出的条件很关键,比如for循环的终止条件,特别注意. 还有这个题目主要考虑到vector的使用,还有注意一定要加上using namespace std; 输出格式,题目中如果没有要求什么最后一行不能有空格什么的,就不要画蛇添足,按照正常的换行就行. 这里采用的是先使用二维字符串数组存储名字,然后名字也有编号,使用这个编号来记录每个课程中选取的学生,巧妙的避免了要记录下字符串的尴尬局面.然后再开辟一个vector容器来记录课程中选课学生的编号,最后排序即可. 如…
1039 Course List for Student (25 分)   Zhejiang University has 40000 students and provides 2500 courses. Now given the student name lists of all the courses, you are supposed to output the registered course list for each student who comes for a query.…
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: E…
1083 List Grades (25 分) Given a list of N student records with name, ID and grade. You are supposed to sort the records with respect to the grade in non-increasing order, and output those student records of which the grades are in a given interval. I…
1109 Group Photo (25 分) Formation is very important when taking a group photo. Given the rules of forming K rows with N people as the following: The number of people in each row must be N/K (round down to the nearest integer), with all the extra peop…
1012 The Best Rank (25 分) To evaluate the performance of our first year CS majored students, we consider their grades of three courses only: C- C Programming Language, M - Mathematics (Calculus or Linear Algrbra), and E - English. At the mean time, w…
1036 Boys vs Girls (25 分) This time you are asked to tell the difference between the lowest grade of all the male students and the highest grade of all the female students. Input Specification: Each input file contains one test case. Each case contai…
A1083 List Grades (25)(25 分) Given a list of N student records with name, ID and grade. You are supposed to sort the records with respect to the grade in non-increasing order, and output those student records of which the grades are in a given interv…
A1075 PAT Judge (25)(25 分) The ranklist of PAT is generated from the status list, which shows the scores of the submittions. This time you are supposed to generate the ranklist for PAT. Input Specification: Each input file contains one test case. For…
A1012 The Best Rank (25)(25 分) To evaluate the performance of our first year CS majored students, we consider their grades of three courses only: C - C Programming Language, M - Mathematics (Calculus or Linear Algebra), and E - English. At the mean t…
A1025 PAT Ranking (25)(25 分) Programming Ability Test (PAT) is organized by the College of Computer Science and Technology of Zhejiang University. Each test is supposed to run simultaneously in several places, and the ranklists will be merged immedia…
To evaluate the performance of our first year CS majored students, we consider their grades of three courses only: C - C Programming Language, M - Mathematics (Calculus or Linear Algrbra), and E - English. At the mean time, we encourage students by e…
1036 Boys vs Girls (25 分)   This time you are asked to tell the difference between the lowest grade of all the male students and the highest grade of all the female students. Input Specification: Each input file contains one test case. Each case cont…
1028 List Sorting (25 分)   Excel can sort records according to any column. Now you are supposed to imitate this function. Input Specification: Each input file contains one test case. For each case, the first line contains two integers N (≤) and C, wh…
1036 Boys vs Girls (25 分)   This time you are asked to tell the difference between the lowest grade of all the male students and the highest grade of all the female students. Input Specification: Each input file contains one test case. Each case cont…
1012 The Best Rank (25分)   To evaluate the performance of our first year CS majored students, we consider their grades of three courses only: C - C Programming Language, M - Mathematics (Calculus or Linear Algrbra), and E - English. At the mean time,…
1036 Boys vs Girls (25分)   This time you are asked to tell the difference between the lowest grade of all the male students and the highest grade of all the female students. Input Specification: Each input file contains one test case. Each case conta…
PTA数据结构与算法题目集(中文)  7-41PAT排名汇总 (25 分) 7-41 PAT排名汇总 (25 分)   计算机程序设计能力考试(Programming Ability Test,简称PAT)旨在通过统一组织的在线考试及自动评测方法客观地评判考生的算法设计与程序设计实现能力,科学的评价计算机程序设计人才,为企业选拔人才提供参考标准(网址http://www.patest.cn). 每次考试会在若干个不同的考点同时举行,每个考点用局域网,产生本考点的成绩.考试结束后,各个考点的成绩将…
PTA数据结构与算法题目集(中文)  7-37 模拟EXCEL排序 (25 分) 7-37 模拟EXCEL排序 (25 分)   Excel可以对一组纪录按任意指定列排序.现请编写程序实现类似功能. 输入格式: 输入的第一行包含两个正整数N(≤) 和C,其中N是纪录的条数,C是指定排序的列号.之后有 N行,每行包含一条学生纪录.每条学生纪录由学号(6位数字,保证没有重复的学号).姓名(不超过8位且不包含空格的字符串).成绩([0, 100]内的整数)组成,相邻属性用1个空格隔开. 输出格式: 在…
题目 This time you are asked to tell the difference between the lowest grade of all the male students and the highest grade of all the female students. Input Specification: Each input file contains one test case. Each case contains a positive integer N…
PAT甲级:1036 Boys vs Girls (25分) 题干 This time you are asked to tell the difference between the lowest grade of all the male students and the highest grade of all the female students. Input Specification: Each input file contains one test case. Each cas…
06-图1 列出连通集   (25分) 给定一个有NN个顶点和EE条边的无向图,请用DFS和BFS分别列出其所有的连通集.假设顶点从0到N-1N−1编号.进行搜索时,假设我们总是从编号最小的顶点出发,按编号递增的顺序访问邻接点. 输入格式: 输入第1行给出2个整数NN(0<N\le 100<N≤10)和EE,分别是图的顶点数和边数.随后EE行,每行给出一条边的两个端点.每行中的数字之间用1空格分隔. 输出格式: 按照"{ v_1v​1​​ v_2v​2​​ ... v_kv​k​​ …
01-复杂度2 Maximum Subsequence Sum   (25分) Given a sequence of K integers { N​1​​,N​2​​, ..., N​K​​ }. A continuous subsequence is defined to be { N​i​​,N​i+1​​, ..., N​j​​ } where 1≤i≤j≤K. The Maximum Subsequence is the continuous subsequence which has…