摘要: #include <bits/stdc++.h> #define int long long using namespace std; const int N = 1e5 + 10; int n, m; int w[N]; struct Node { int l, r; int tag, sum; 阅读全文
posted @ 2022-02-12 18:26 Angels_of_Death 阅读(30) 评论(0) 推荐(0)
摘要: #include <bits/stdc++.h> using namespace std; const int N = 1e5 + 10; int n, m; int a[N]; struct Node { int l, r; int sum, lmax, rmax, tmax; }tr[N * 4 阅读全文
posted @ 2022-02-12 17:23 Angels_of_Death 阅读(25) 评论(0) 推荐(0)
摘要: dfs序 + 状态压缩 + 线段树 #include <bits/stdc++.h> #define LL long long using namespace std; const int N = 4e5 + 10, M = N * 2; int n, m; int w[N], h[N], e[M] 阅读全文
posted @ 2022-02-12 11:31 Angels_of_Death 阅读(42) 评论(0) 推荐(0)
摘要: #include <bits/stdc++.h> using namespace std; const int N = 5e5 + 10; int n, m; int a[N]; struct Node { int l, r; int lmax, rmax, tmax; /* lmax 表示从该区间 阅读全文
posted @ 2022-02-11 11:27 Angels_of_Death 阅读(51) 评论(0) 推荐(0)
摘要: #include <bits/stdc++.h> using namespace std; const int N = 5e5 + 10; int n, m; int a[N]; struct Node { int l, r; int sum, lmax, rmax, tmax; //sum, // 阅读全文
posted @ 2022-02-11 00:41 Angels_of_Death 阅读(27) 评论(0) 推荐(0)
摘要: 二进制下的每一位用一个线段树维护,一共拆分成32棵线段树 #include <bits/stdc++.h> #define LL long long using namespace std; const int N = 1e5 + 10; int n, m; int a[N]; struct nod 阅读全文
posted @ 2022-02-10 23:50 Angels_of_Death 阅读(40) 评论(0) 推荐(0)
摘要: https://atcoder.jp/contests/abc237/tasks/abc237_f 考虑用二分做最长上升子序列的数组的表示方法 \(f[i][j][k][l]表示从前i个选,长度为1的最长上升子序列中最小的数为j,长度为2的最长上升子序列中最后一个数最小的数为k,长度为3的最长上升子 阅读全文
posted @ 2022-02-07 11:42 Angels_of_Death 阅读(56) 评论(0) 推荐(0)
摘要: A class Solution { public: vector<int> sortEvenOdd(vector<int>& nums) { vector<int> a, b, v; for (int i = 0; i < nums.size(); i ++ ) if (i % 2 == 0) a 阅读全文
posted @ 2022-02-06 12:03 Angels_of_Death 阅读(30) 评论(0) 推荐(0)
摘要: #include <bits/stdc++.h> #define LL long long using namespace std; const int N = 5e5 + 10; int n, m, len; LL ans; int a[N], num[N]; struct node { int 阅读全文
posted @ 2022-02-06 00:28 Angels_of_Death 阅读(30) 评论(0) 推荐(0)
摘要: A #include <bits/stdc++.h> #define int long long using namespace std; signed main() { int n; cin >> n; if (n == 1) {puts("Yes"); return 0;} if (n > 4) 阅读全文
posted @ 2022-02-05 23:25 Angels_of_Death 阅读(68) 评论(0) 推荐(0)