
贪心
阿晴0917
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
Codeforces1291B. Array Sharpening 构造先增后减 C贪心1700
数组符合先严格递增后递减 0=<ai<=1e9 n<=3e5ai-=1任意次直接递增或递减也成立101248618312 10 86100 11 15 9 7 840 1 1 020 020 121 021 130 1 031 0 1YesYesYesNoNoYesYesYesYesNohttps://code...原创 2020-02-07 21:36:15 · 286 阅读 · 0 评论 -
Codeforces1092C 贪心 B 双指针 A字符串最长前缀后缀
枚举删除一个区间multiset 左边找最大值 右边找最小值r-l值的最大#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 INF=0x3f3f3f...原创 2019-12-06 23:13:46 · 377 阅读 · 1 评论 -
L-鸡尾酒买罐子 贪心枚举 假二分
https://ac.nowcoder.com/acm/contest/321/L#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 ios::s...原创 2019-11-23 00:33:43 · 134 阅读 · 0 评论 -
Codeforces1255B 成环特判 C构造
https://codeforces.com/contest/1255/standings/friends/true#include<bits/stdc++.h>using namespace std;typedef long long ll;const int maxn=6e5+5;const ll mod=1e9+7;#define IO ios::sync_with_...原创 2019-11-20 09:12:36 · 162 阅读 · 0 评论 -
Codeforces1257 D - Yet Another Monster Killing Problem 贪心 区间延续
b数组卡memset超时scanf 比IO cin cout 快4倍#include<bits/stdc++.h>using namespace std;typedef long long ll;const int maxn=6e5+5;const ll mod=1e9+7;#define IO ios::sync_with_stdio(false);cin.tie(0...原创 2019-11-15 17:27:42 · 232 阅读 · 0 评论 -
Codeforces1256C - Platforms Jumping 1256B - Minimize the Permutation F. Equalizing Two Strings
https://codeforces.com/contest/1256/problem/En,m,d<=1000 复杂度O(n2)#include<bits/stdc++.h>using namespace std;typedef long long ll;const int maxn=1e6+5;ll n,m,d,t;ll c[maxn],ans[maxn];...原创 2019-11-09 22:30:34 · 171 阅读 · 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 · 164 阅读 · 0 评论 -
Codeforces1238 解题报告
B二分修改次数1-cnt(去重)次 从大到小排 大的vis[i]=1D字符串的子串good的个数要想good 分成的每一部分都是回文串,回文串长度>1合法情况=总情况不包括长度为1的(必不是回文串)-不合法的情况n=5 长度为5 1个 4 2个 3 3个 2 4个#include<bits/stdc++.h>using namespace std;typedef...原创 2019-10-09 23:05:59 · 193 阅读 · 0 评论 -
补丁题 贪心 分段
描述鸡尾酒的轮胎被扎了很多洞,于是他需要打一些补丁来覆盖这些洞。但是由于他的时间有限,他只能打M个补丁,但是每个补丁的长度任意。注意:轮胎不是环给出:可以打的补丁个数 M(1 \le M \le 50)M(1≤M≤50);轮胎的长度 S(1 \le S \le 200)S(1≤S≤200);漏洞的个数 C(1 \le C \le S)C(1≤C≤S);漏洞的位置 stall_number(1...原创 2019-08-25 11:31:35 · 120 阅读 · 0 评论 -
Codeforces723 B字符串模拟 C 贪心
https://codeforces.com/contest/723/problem/Cn个乐队编号代表演出 (1<=ai<=1e9)喜欢的乐队编号1-m (n,m<=2000)更改一些值 使得b1…bm 喜欢的乐队表演的数目 最小值最大即平均值输出尽量大的最小值和最小改变量缺多少改多少#include<bits/stdc++.h>using name...原创 2019-08-11 10:10:34 · 192 阅读 · 0 评论 -
Codeforcs1163B 数据结构 模拟 C计算几何
https://codeforces.com/contest/1163/problem/B2#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(fal...原创 2019-08-13 16:44:22 · 127 阅读 · 0 评论 -
FF坐飞机easy版 贪心排序 我竟然不会
相邻的两个才会形成弟弟配合 最多n-1个 ci>ai+1Input输入描述:先给出两个正整数n和t,代表买了n张机票,所有飞机晚点时间和为t。然后接下来n行,每行给出两个时间描述一个飞机的起飞和降落时间。(1<n<=1e5,1<=t,a,b<=1e9)Output输出一行一个整数代表经过分配晚点时间后,最多的弟弟配合有多少组。3 21 22 33 4...原创 2019-04-04 19:54:04 · 184 阅读 · 0 评论 -
Codeforces1003D.Coins and Queries(贪心1600)爆num数组 map
#include#include#include#include#include#include#include#include#include#include#include#includeusing namespace std;#define PI acos(-1.0)#define mp make_pairtypedef long long ll;typed...原创 2019-02-18 19:32:34 · 199 阅读 · 0 评论