摘要: 和这道题真的有壁,拿起来就做,然后做错了。又看了半天题目,才知道大概啥意思。 每一轮都需要给人数最多的学校分配位置,如果人数大于c,分配一个教室剩下的人还要再放回进行第二轮,而不是一次性给这个学校分配完。 #include <bits/stdc++.h> using namespace std; c 阅读全文
posted @ 2024-03-28 19:49 YuKiCheng 阅读(314) 评论(0) 推荐(0)
摘要: 纯模拟。 #include <bits/stdc++.h> using namespace std; int cnt = 0,maxlen=0; int main() { vector<int> a, b; int n; cin >> n; for (int i = 0; i < n; i++) { 阅读全文
posted @ 2024-03-28 15:20 YuKiCheng 阅读(153) 评论(0) 推荐(0)
摘要: 测试点4一开始没过去,以为是数据范围的问题。 找半天才发现是floyd三层循环k那个写反了,害。 #include <bits/stdc++.h> using namespace std; vector<int> male,female; int dis[510][510]; int main() 阅读全文
posted @ 2024-03-28 12:39 YuKiCheng 阅读(83) 评论(0) 推荐(0)
摘要: 考察的是贪心+记忆化搜索。 最短路=走过的路径*2-从根到小区最深路径长度 #include <bits/stdc++.h> using namespace std; const int maxn = 1e5 + 10; int p[maxn],dis[maxn],dp[maxn]; int max 阅读全文
posted @ 2024-03-28 09:10 YuKiCheng 阅读(100) 评论(0) 推荐(0)