随笔分类 - acm
摘要:A #include <bits/stdc++.h> #define LL long long using namespace std; int T, n, m; void solve() { scanf("%d", &n); int res = 0; for (int i = 1; i <= n;
阅读全文
摘要:A #include <bits/stdc++.h> using namespace std; int main() { int a, b; scanf("%d%d", &a, &b); if (a > b) swap(a, b); if (b - a == 1 || b - a == 9) put
阅读全文
摘要:A #include <bits/stdc++.h> using namespace std; int main() { int x; scanf("%d", &x); printf("%.10lf\n", sqrt((12800000 + x)) * sqrt(x)); return 0; } B
阅读全文
摘要:A #include <bits/stdc++.h> #define LL long long using namespace std; const int N = 1e5 + 10; int n; int a[N]; void solve() { scanf("%d", &n); for (int
阅读全文
摘要:A class Solution { public: int countOperations(int num1, int num2) { int cnt = 0; while (num1 != 0 && num2 != 0) { if (num1 >= num2) num1 -= num2; els
阅读全文
摘要:动态开点只能开$Ofast$莽过去 #pragma GCC optimize("Ofast") #include <bits/stdc++.h> using namespace std; const int N = 15000010; int n, Q, root, cnt, L[N], R[N],
阅读全文
摘要:#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; }tr[N * 4
阅读全文
摘要:#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;
阅读全文
摘要:#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
阅读全文
摘要:#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 表示从该区间
阅读全文
摘要:#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, //
阅读全文
摘要:二进制下的每一位用一个线段树维护,一共拆分成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
阅读全文
摘要:https://atcoder.jp/contests/abc237/tasks/abc237_f 考虑用二分做最长上升子序列的数组的表示方法 \(f[i][j][k][l]表示从前i个选,长度为1的最长上升子序列中最小的数为j,长度为2的最长上升子序列中最后一个数最小的数为k,长度为3的最长上升子
阅读全文