- 博客(7)
- 收藏
- 关注
原创 1022 Digital Library
1022 Digital Library 1022 Digital Library 知识点: getline(cin,string) 读取一行到字符串 cin 后不会读取’\n’ 要getchar() 详情 code: #include<unordered_map> #include<vector> #include<string> #include<iostream> #include<algorithm> using namespace s
2022-05-10 00:50:37
67
原创 PAT 甲级 排序类题集
是根据弄夫大佬的bilibili课程分类专题,练习的。 1028 List Sorting 25 ListSortingList SortingListSorting error code:20 偷懒使用string读入,则当col==3时, string 是字典排序表,对于成绩60和9, str(60)<str(9)str(60)<str(9)str(60)<str(9) #include<iostream> #include<vector> #include&l
2022-05-09 23:41:41
102
原创 1062 Talent and Virtue
1062 Talent and Virtue 1062 Talent and Virtue #include<vector> #include<algorithm> #include<iostream> #include<string> using namespace std; struct peo{ string id;int virtue,total; }; bool cmp(const peo& a,const peo& b){
2022-05-09 23:37:49
63
原创 1047 Student List for Course
可能有重名学生:用multiset #include<map> #include<set> #include<vector> #include<iostream> using namespace std; int main(){ int n,k,c,cr;//人数,总课数,单人课数,课 cin>>n>>k; multiset<int>cor[2510];//可能有重名学生:用multiset
2022-05-08 19:33:12
147
原创 1029 Median
1029 Median #include<iostream> #include<algorithm> using namespace std; const int N=2e5+10; int w1[N],w2[N]; int main(){ int n1,n2; cin>>n1; for(int i=0;i<n1;i++) scanf("%d",&w1[i]); cin>>n2; for(int i=0;
2022-05-08 17:30:22
146
原创 1053 Path of Equal Weight
1053 Path of Equal Weight 30 1053PathofEqualWeight1053 Path of Equal Weight1053PathofEqualWeight error code 28 error:测试点2 用string记录路径但是排序是字典排序,所以str(9)>str(60)str(9)>str(60)str(9)>str(60) 即 :1->6->51 > 1->51->6 当然,要是记录路径时候,把‘6’记录成‘0
2022-05-08 16:17:23
194
原创 1034 Head of a Gang
#include<vector> #include<string> #include<unordered_map> #include<iostream> #include<algorithm> using namespace std; typedef pair<string,int> psi;//headName cnt const int N=5e3; int w[N];//id->所对应的总权重 bool st[N]; str
2022-05-07 13:45:45
69
1
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人