摘要: 思路:如果是奇数数个商店,排序后选中间的那个为货仓位置。如果是偶数个,排序后选取 n / 2或者 n / 2 + 1位置的商店。 #include<bits/stdc++.h> using namespace std; const int N=1e5+10; int main() { int n; 阅读全文
posted @ 2021-01-12 17:02 Swelsh-corgi 阅读(60) 评论(0) 推荐(0) 编辑
摘要: 题意:求连通块内点的个数 思路:BFS 跑一遍,看看能到达那些点,记录下来,然后统计一下 #include<bits/stdc++.h> using namespace std; const int N=1e5+10; int vis[25][25]; int dis[4][2]= {-1,0,1, 阅读全文
posted @ 2021-01-12 16:55 Swelsh-corgi 阅读(70) 评论(0) 推荐(0) 编辑