PAT 1039 Course List for Student[难]】的更多相关文章

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. I…
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. Input Specification: Each input file…
题目 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. Input Specification: Each input fi…
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.…
题目链接:http://www.patest.cn/contests/pat-a-practise/1039 题目: 1039. Course List for Student (25) 时间限制 200 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue Zhejiang University has 40000 students and provides 2500 courses. Now given the student…
博主欢迎转载,但请给出本文链接,我尊重你,你尊重我,谢谢~http://www.cnblogs.com/chenxiwenruo/p/6789157.html特别不喜欢那些随便转载别人的原创文章又不给出链接的所以不准偷偷复制博主的博客噢~~ 题意:给出要查询的n个学生,k个课程接下来对于k门课,给出其id和学生数量,以及对应的学生名字租后给出n个查询的学生名字,让你输出其选的课程数量和对应的课程id,id从小到大排序. 题目简单,然而建立映射的想法不错~~推荐一开始发生段错误,才发现n的范围只是…
map会超时,二分吧... #include<iostream> #include<cstring> #include<cmath> #include<algorithm> #include<cstdio> #include<map> #include<queue> #include<string> #include<vector> using namespace std; int n,m; int…
题意: 输入两个正整数N和K(N<=40000,K<=2500),分别为学生和课程的数量.接下来输入K门课的信息,先输入每门课的ID再输入有多少学生选了这门课,接下来输入学生们的ID.最后N次询问,输入学生的ID输出该学生选了多少们课,输出所选课程的数量,按照递增序输出课程的ID. trick: 第5个数据点出现段错误,把原本以map存学生对应ID再映射vector存储该学生所选课程改成vector嵌套在map内,就没有段错误的问题出现,疑似映射过程中指针漂移??? AAAAAccepted…
1044 Shopping in Mars(25 分) Shopping in Mars is quite a different experience. The Mars people pay by chained diamonds. Each diamond has a value (in Mars dollars M$). When making the payment, the chain can be cut at any position for only once and some…
1039 到底买不买(20)(20 分) 小红想买些珠子做一串自己喜欢的珠串.卖珠子的摊主有很多串五颜六色的珠串,但是不肯把任何一串拆散了卖.于是小红要你帮忙判断一下,某串珠子里是否包含了全部自己想要的珠子?如果是,那么告诉她有多少多余的珠子:如果不是,那么告诉她缺了多少珠子. 为方便起见,我们用[0-9].[a-z].[A-Z]范围内的字符来表示颜色.例如在图1中,第3串是小红想做的珠串:那么第1串可以买,因为包含了全部她想要的珠子,还多了8颗不需要的珠子:第2串不能买,因为没有黑色珠子,并且…