
模拟
blue_sister
这个作者很懒,什么都没留下…
展开
-
1129 Recommendation System (25 分)
传送门 1.重载 < 2.set //解法一 #include <cstdio> #include <set> using namespace std; int book[50001]; struct node { int value, cnt; node(int a, int b):value(a), cnt(b){} bool operator < (const node &a) const { return (cnt原创 2021-04-28 15:57:32 · 112 阅读 · 0 评论 -
1080 Graduate Admission (30 分)
1.模拟 2.结构体排序 3.个顶序列赋排名 #include<bits/stdc++.h> using namespace std; vector<vector<int > > school; int n,k,c; struct node{ int id; int ge,gl; int sum; int c_s[5]; }; vector<node > people; vector<int > w,ranks; b原创 2021-03-31 22:49:57 · 71 阅读 · 0 评论 -
1056 Mice and Rice (25 分)
传送门 dfs+模拟 回溯:维护rank 按权值排序 STL:a.insert(a.end(),b.begin(),b.end()); 将一个容器拼接到另一容器尾部 #include<bits/stdc++.h> using namespace std; int n ,m,ranks=0; vector<int > ans, weight,indexs; bool cmp(int a,int b){ return weight[a] < weight[b]; } //原创 2021-03-23 23:47:06 · 80 阅读 · 0 评论