
二分
yjt9299
这个作者很懒,什么都没留下…
展开
-
Ice Cream Tower The 2016 ACM-ICPC Asia China-Final Contest
挺好的一个二分加贪心的题目 。。 思想虽然不是很难,但是 也许还可以。题意: 题目含义就类似于堆雪人堆蛋糕,,要求下一层至少是上一层的两倍。 给你一个k 表示层数 给你n个 数 表示每一层的大小 问你最多能堆成几个k层的 雪人。 思路: 最少堆成 0个 最多堆成 n/k 个。(二分 n/k ) 如果将最大堆成n个 会超时。 剩下的就是贪心的过程 , 给你一个原创 2017-11-07 14:24:03 · 346 阅读 · 0 评论 -
codeforces D. Levko and Array(二分加dp) 挺好的一个题
D. Levko and Arraytime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputLevko has an array that consists of inte原创 2017-12-19 10:55:53 · 375 阅读 · 0 评论 -
fzu 2219 很好的二分题呀
Problem 2219 StarCraftAccept: 278 Submit: 798Time Limit: 1000 mSec Memory Limit : 32768 KB Problem DescriptionZB loves playing StarCraft and he likes Zerg most!One day, when ZB was playing SC2,...原创 2018-04-15 17:05:14 · 226 阅读 · 0 评论 -
fzu 2216
Problem 2216 The Longest StraightAccept: 497 Submit: 1546Time Limit: 1000 mSec Memory Limit : 32768 KB Problem DescriptionZB is playing a card game where the goal is to make straights. Each car...原创 2018-04-15 20:12:55 · 171 阅读 · 0 评论 -
牛客多校第二场g题 transform
思路: 二分因为对于物品个数打一个前缀和的话,是具有单调性的。 所以可以用二分的思想。在jud函数中借鉴了大佬们的尺取写法。我们可以二分答案,然后jud中枚举左端点,然后可以二分右端点和mid点,可能细节多一些。比较好的一个办法就是尺取的写法。代码: #include<bits/stdc++.h>using namespace std;typedef long l...原创 2018-07-24 10:58:15 · 298 阅读 · 0 评论 -
codeforces 799C
链接: http://codeforces.com/contest/799/problem/C思路: 二分+ 后缀 代码:#include<bits/stdc++.h>using namespace std;typedef long long ll;typedef pair<int ,int > pii;const int N =1e5+5;con...原创 2018-09-10 01:20:34 · 255 阅读 · 0 评论 -
codeforces 689d Friends and Subsequences(rmq+ 二分)
链接: http://codeforces.com/contest/689/problem/D题意: 给你两个序列 你要求出有多少对 L ,R 使得A中的最大值等于B中的最小值。思路: 先预处理出rmq 那么枚举每一个位置,找出这个位置的最小右端点和最大右端点就可以了。那么就用二分判断呗。因为对于每一个位置maxx 肯定是升序的,minn 肯定是降序的。代码:#include...原创 2018-09-24 13:06:04 · 284 阅读 · 0 评论 -
codeforces 374D. Inna and Sequence(特别有意思哈)
链接: http://codeforces.com/contest/374/problem/D题意: 首先给你 n 和 m 然后m 个数,表示位置,这里首先有一个空的序列 然后n 个操作,如果操作是1 那么向序列的末尾加1 ,如果操作是0 ,那么向序列的末尾加0 如果是-1 ,那么删除上边给的m 个位置的数,最后输出序列。为空输出。。。思路: 因为n m都比较大一开始还真不敢想,然后其...原创 2018-10-26 15:13:32 · 407 阅读 · 0 评论