STL
阿晴0917
这个作者很懒,什么都没留下…
展开
-
L1-027 出租 L2-014 列车调度 set二分
https://pintia.cn/problem-sets/994805046380707840/problems/994805107638517760#include<bits/stdc++.h>using namespace std;typedef long long ll;#define IO ios::sync_with_stdio(false);cin.tie(0...原创 2020-03-04 22:04:05 · 161 阅读 · 0 评论 -
L2-032 彩虹瓶 栈 有另一个容器暂时存 L3-002 特殊堆栈 L3-003 社交集群 L3-001凑零钱dfs L1-019. 谁先倒 L2-004 这是二叉搜索树吗 L1-009N个数求和
https://pintia.cn/problem-sets/994805046380707840/problems/1111914599412858889#include<bits/stdc++.h>using namespace std;typedef long long ll;const int maxn=2e5+5;ll n,m,k,a[maxn],f,num,s;...原创 2020-03-01 20:45:52 · 177 阅读 · 0 评论 -
Codeforces1304B 字符串STL构造最长回文 C. Air Conditioner 温度范围双指针 D双指针构造LIS最短最长
考虑本身回文 和 nnm寻找互相回文本身回文有多个 因为长度都为m 找出现次数最大的自身回文的串4 2oooxxoxx6oxxxxo9 4ababbabaabcdbcdecdefdefgwxyzzyxwijji20ababwxyzijjizyxwbaba#include<bits/stdc++.h>using namespace std;t...原创 2020-02-21 13:07:48 · 192 阅读 · 0 评论 -
Codeforces1296B模拟 C二维坐标 pair map D 贪心取余
https://codeforces.com/contest/1296/standings对数s 每次spend x obtain x/10下取整最终spend最大值10ans=119876ans=10973#include<bits/stdc++.h>using namespace std;typedef long long ll;const int maxn=...原创 2020-02-11 12:38:35 · 236 阅读 · 0 评论 -
Codeforces Round #611 (Div. 3) 解题报告 D优先队列最短距离
https://codeforces.com/contest/1283/problem/CSTL erase更快保证至少有两个位置为0 自己不能给自己送礼物#include<bits/stdc++.h> //保证至少两个fi=0using namespace std;const int maxn=2e5+5;typedef long long ll;ll n,t,f[ma...原创 2020-01-10 10:33:26 · 140 阅读 · 0 评论 -
stl 嵌套 multiset
#include<bits/stdc++.h>using namespace std;const int maxn=2e5+5;//2^17=131072const int lgn=19;typedef long long ll;#define endl '\n'#define IO ios::sync_with_stdio(false);cin.tie(0);set...原创 2020-01-08 21:10:07 · 122 阅读 · 0 评论 -
Codeforces1108E1 - Array and Segments (Easy version)
https://codeforces.com/contest/1108/problem/E1#include<bits/stdc++.h>using namespace std;typedef long long ll;const int INF = 0x3f3f3f3f;const int maxn=1e5+5;ll n,m; int main(){ cin>...原创 2020-01-07 16:31:08 · 198 阅读 · 0 评论 -
2019长安大学新生赛
Aa b c d排序后 a,b,c之间距离两两至少为d相当于相邻两个至少为d两边与中间分别判断#include<bits/stdc++.h>#include<string>using namespace std;typedef long long ll;const int maxn=1e6+5;const ll mod=1e9+7;const int ...原创 2019-12-09 00:51:45 · 180 阅读 · 0 评论 -
Codeforces1263B. PIN Codes 字符串 A 数学 r g b
https://codeforces.com/contest/1263/problem/B#include<bits/stdc++.h>using namespace std;typedef long long ll;const int maxn=1e6+5;const ll mod=1e9+7;const int INF=0x3f3f3f3f;#define IO io...原创 2019-12-03 22:59:08 · 165 阅读 · 0 评论 -
Codeforces1243B2 STL字符串模拟
https://codeforces.com/contest/1243/problem/B2最多遍历时将1对交换2次交换至多2n次1=<m<=2n每次交换s[i]与t[j] 最终使得s t串相等45sousehouhe3catdog2aaaz3abcbcaYes11 4NoNoYes31 23 12 3#include<bi...原创 2019-11-07 23:15:28 · 292 阅读 · 0 评论 -
Codeforces1251D二分 B字符串奇偶性 A双指针 E优先队列维护贪心
https://codeforces.com/contest/1251/problem/D#include<bits/stdc++.h>using namespace std;const int maxn=1e6+5;typedef long long ll;#define rep(i,a,n) for(int i=a;i<=n;i++)ll t,n,s,m,vis[...原创 2019-10-28 21:10:42 · 135 阅读 · 0 评论 -
Codeforces1092D1/D2 栈
D1ll a[maxn],b[maxn];int vis[maxn];stack<ll> s;int main(){ cin>>n; rep(i,1,n){ cin>>a[i]; a[i]=a[i]&1; } rep(i,1,n){ if(s.empty() || s.top()!=a[i]){ s.push(a[i])...原创 2019-08-19 17:01:53 · 178 阅读 · 0 评论 -
Codeforces Round #538 (Div. 2) B.Yet Another Array Partitioning Task(构造)
An array b is called to be a subarray of a if it forms a continuous subsequence of a, that is, if it is equal to al, al+1, …, ar for some l,r.Suppose m is some known constant. For any array, having m...原创 2019-02-12 00:33:55 · 159 阅读 · 0 评论 -
Codeforces1157E multiset二分
multiset不去重 自动排序 直接贪心二分查找第一个>=差值的数找不到取当前最小值#include<bits/stdc++.h>#include<set>using namespace std;typedef long long ll;const int maxn=2e5+5;const ll inf=0x3f3f3f3f3f3f3f3f;cons...原创 2019-04-29 21:29:24 · 224 阅读 · 0 评论 -
gym101972
E. Stupid Submissions (暴力模拟)https://codeforces.com/gym/101972/problem/EWhen Abed gets a wrong answer on test x (x ≤ n), he can see all the tests up to test number x. If Abed gets accepted, he can se...原创 2019-04-26 00:17:36 · 293 阅读 · 0 评论 -
Codeforces1183D STL不超时
https://codeforces.com/contest/1183/problem/D==sort(num.rbegin(),num.rend());==逆序#include<bits/stdc++.h>#include<deque>using namespace std;#define IO ios::sync_with_stdio(false);cin.t...原创 2019-07-23 19:23:23 · 208 阅读 · 0 评论 -
Codeforces1182B. Plus from Picture dfs好题 C. Beautiful Lyrics STL
https://codeforces.com/contest/1182/problem/B首先判断四周是否为* 并且向四周延伸 * 的数量与遍历整个图 *的数量是否相等枚举时 从2开始不会越界 并且在边界形成不了十字#include<bits/stdc++.h>using namespace std;typedef long long ll;typedef pair<...原创 2019-08-03 14:14:13 · 290 阅读 · 0 评论 -
Codeforces1199 C mp3 map种类数滑窗前缀和
#include<bits/stdc++.h>using namespace std;typedef long long ll;typedef pair<int,int> pii; //1e9typedef pair<ll,ll> pll;const int maxn=4e5+5;const int INF=0x3f3f3f3f;#define r...原创 2019-07-31 14:08:17 · 155 阅读 · 0 评论 -
Codeforces1156 A画图 Bset 迭代器 C贪心二分
1 圆2 三角形 底与高相等3 正方形3 1 2 三点重合https://codeforces.com/contest/1156/problem/All n,k;ll a[maxn];ll res=0;int main(){ cin>>n; rep(i,1,n) cin>>a[i]; rep(i,1,n-1){ if(a[i]==1) { ...原创 2019-08-05 16:42:02 · 189 阅读 · 0 评论 -
Codeforces1092C STL
https://codeforces.com/contest/1092/problem/C集合count()函数字符串empty() clear()函数注意check不一定第一次就成功 每次都要置空ans="";题意:对长度为n的目标串 给2*n-2个它的子串长度为1-n-1的前缀各一个长度为1-n-1的后缀各一个#include <bits/stdc++.h>#de...原创 2019-08-18 20:11:52 · 169 阅读 · 0 评论 -
Codefocs1095C 优先队列
n=9 k=4分成4份2的幂次的形式4 2 2 1#include <bits/stdc++.h>#define rep(i,a,n) for (int i=a;i<=n;i++)#define pb push_back#define mp make_pair#define IO ios::sync_with_stdio(false)#define fi firs...原创 2019-08-13 22:28:26 · 226 阅读 · 0 评论 -
Codeforces Round #532 (Div. 2) B. Build a Contest(映射) 1300
Arkady coordinates rounds on some not really famous competitive programming platform. Each round features n problems of distinct difficulty, the difficulties are numbered from 1 to n.To hold a round ...原创 2019-02-07 20:37:30 · 477 阅读 · 0 评论