随笔分类 - 贪心
摘要:单调性 点击查看代码 #include<bits/stdc++.h> using namespace std; typedef long long LL; const int N = 1e6 + 10; int n, m, op; int a[N]; void solve() { scanf("%d
阅读全文
摘要:差分 + 贪心 点击查看代码 #include<bits/stdc++.h> using namespace std; typedef long long LL; const int N = 1e5 + 10; int n; int a[N], b[N]; void solve() { cin >>
阅读全文
摘要:贪心 + 单调栈 点击查看代码 #include<bits/stdc++.h> using namespace std; typedef long long LL; const int N = 1e6 + 10; int n, k; int a[N]; void solve() { cin >> n
阅读全文
摘要:点击查看代码 #include<iostream> #include<algorithm> using namespace std; typedef pair<int,int> PII; const int N = 1e5 + 10; int n; PII cow[N]; int main() {
阅读全文
摘要:点击查看代码 #include<iostream> #include<algorithm> using namespace std; const int N = 1e5 + 10; int n, res; int a[N]; int main() { cin >> n; for (int i = 0
阅读全文
摘要:点击查看代码 #include<iostream> #include<algorithm> using namespace std; typedef long long LL; const int N = 1e5 + 10; int n; LL res; int a[N]; int main() {
阅读全文
摘要:点击查看代码 #include<iostream> #include<vector> #include<queue> using namespace std; int n, res; priority_queue<int,vector<int>,greater<int>> heap; int mai
阅读全文
摘要:点击查看代码 #include<iostream> #include<algorithm> using namespace std; const int N = 1e5 + 10; int st, ed, n, res; struct Range { int l, r; bool operator
阅读全文
摘要:差分 + 贪心 点击查看代码 #include<bits/stdc++.h> using namespace std; typedef long long LL; const int N = 1e5 + 10; int n; void solve() { cin >> n; vector<pair<
阅读全文
摘要:点击查看代码 #include<iostream> #include<cstring> #include<algorithm> using namespace std; const int N = 1e5 + 10; int n; struct Range { int l, r; bool oper
阅读全文
摘要:点击查看代码 #include<iostream> #include<cstring> #include<algorithm> using namespace std; const int N = 1e5 + 10; int n; struct Range { int l, r; bool oper
阅读全文