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:…
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…
PAT甲级:1089 Insert or Merge (25分) 题干 According to Wikipedia: Insertion sort iterates, consuming one input element each repetition, and growing a sorted output list. Each iteration, insertion sort removes one element from the input data, finds the loca…
1145 Hashing - Average Search Time (25 分)   The task of this problem is simple: insert a sequence of distinct positive integers into a hash table first. Then try to find another sequence of integer keys from the table and output the average search ti…
1066 Root of AVL Tree (25 分)   An AVL tree is a self-balancing binary search tree. In an AVL tree, the heights of the two child subtrees of any node differ by at most one; if at any time they differ by more than one, rebalancing is done to restore th…
1055 The World's Richest (25 分)   Forbes magazine publishes every year its list of billionaires based on the annual ranking of the world's wealthiest people. Now you are supposed to simulate this job, but concentrate only on the people in a certain r…
题意: 输入两个正整数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…
https://pintia.cn/problem-sets/994805342720868352/problems/994805433955368960 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…
题意: 输入一个正整数N(<=20),代表结点个数(0~N-1),接着输入N行每行包括每个结点的左右子结点,'-'表示无该子结点,输出是否是一颗完全二叉树,是的话输出最后一个子结点否则输出根节点. trick: 用char输入子结点没有考虑两位数的结点…
题意: 输入三个正整数N,L,H(N<=1E5,L>=60,H<100,H>L),分别代表人数,及格线和高水平线.接着输入N行数据,每行包括一个人的ID,道德数值和才能数值.一个人的道德和才能都不低于H时为圣人,道德不低于H才能不低于L时为贵族,道德和才能都不低于L且道德不低于才能时为愚者,道德和才能都不低于L且道德低于才能时为小人(圣人优先判断,圣人的才能可以高于道德).分别在自己的所在的群体内排序,依照道德才能总和降序排序,第二优先为才能的数值降序,第三优先为id的升序.按照题…