上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 30 下一页
摘要: #include <bits/stdc++.h> using namespace std; int main() { int n, q; cin >> n >> q; vector<int> v; make_heap(v.begin(), v.end(), greater<int>()); for 阅读全文
posted @ 2022-03-17 10:27 Xxaj5 阅读(13) 评论(0) 推荐(0) 编辑
摘要: #include <bits/stdc++.h> using namespace std; const int N = 10110; struct Tree { int u, l, r; }TNode[N]; int midorder[N], preorder[N]; int main() { in 阅读全文
posted @ 2022-03-17 09:01 Xxaj5 阅读(33) 评论(0) 推荐(0) 编辑
摘要: #include <bits/stdc++.h> using namespace std; constexpr int N = 110; int f[N]; int find(int x) { if (x != f[x]) return f[x] = find(f[x]); return f[x]; 阅读全文
posted @ 2022-03-16 20:04 Xxaj5 阅读(51) 评论(0) 推荐(0) 编辑
摘要: #include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; struct p { int id, money, cnt;}; vector<p> person(n + 1); for (int i = 1; 阅读全文
posted @ 2022-03-16 19:50 Xxaj5 阅读(32) 评论(0) 推荐(0) 编辑
摘要: 分两种情况枚举中间点 #include <bits/stdc++.h> using namespace std; int main() { string s; getline(cin, s); int n = s.size(); int res = 1; for (int i = 0; i < n; 阅读全文
posted @ 2022-03-16 19:24 Xxaj5 阅读(16) 评论(0) 推荐(0) 编辑
摘要: //并查集 #include <bits/stdc++.h> using namespace std; constexpr int N = 10010; constexpr double eps = 1e-8; int f[N]; //int Size[N]; //集合的人数 vector<int> 阅读全文
posted @ 2022-03-16 17:25 Xxaj5 阅读(18) 评论(0) 推荐(0) 编辑
摘要: 先建树,再BFS #include <bits/stdc++.h> using namespace std; vector<int> tree[35]; int main() { ios::sync_with_stdio(false); cin.tie(0); int n; cin >> n; ve 阅读全文
posted @ 2022-03-15 21:35 Xxaj5 阅读(54) 评论(0) 推荐(0) 编辑
摘要: #include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(0); int n; cin >> n; vector<vector<int>> v; for (int i 阅读全文
posted @ 2022-03-15 20:29 Xxaj5 阅读(29) 评论(0) 推荐(0) 编辑
摘要: #include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; vector<int> v(n); for (int i = 0; i < n; i++) { cin >> v[i]; } vector<int> 阅读全文
posted @ 2022-03-15 20:28 Xxaj5 阅读(33) 评论(0) 推荐(0) 编辑
摘要: #include <bits/stdc++.h> using namespace std; int main() { int n, need; cin >> n >> need; vector<double> have(n); vector<double> price(n); for (int i 阅读全文
posted @ 2022-03-14 22:43 Xxaj5 阅读(21) 评论(0) 推荐(0) 编辑
上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 30 下一页