
尺取
UCAS王小二
不念过去,不畏未来...
展开
-
玲珑杯 1149 - Buildings【线段树+尺取】
“玲珑杯”ACM比赛 Round #19题意: 给出n,k值,接下来一行是楼房的高度(序列不能排序),按照题中的公式求取满足条件的楼房对数; 思路: 本题无非是更新区间最大值,最小值,其次利用尺取的思想。每更新一个值(也就是r向前移动一位)就查询一次,满足条件时:sum += r - l (比赛时最小值查询写错了,好菜啊)#include<bits/stdc++.h> int p[200000原创 2017-07-30 09:35:27 · 1859 阅读 · 0 评论 -
poj 3061 Subsequence【简单尺取】
Subsequence Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 15330 Accepted: 6480 Description A sequence of N positive integers (10 < N < 100 000), each o原创 2017-07-19 17:05:04 · 236 阅读 · 0 评论 -
CodeForces - 895
CodeForces - 895A Pizza Separation Students Vasya and Petya are studying at the BSU (Byteland State University). At one of the breaks they decided to order a pizza. In this problem pizza is a circle原创 2017-12-03 13:12:59 · 540 阅读 · 2 评论 -
Wannafly挑战赛23
A:经典尺取。。。 #pragma GCC optimize (&quot;O3&quot;) #pragma GCC optimize (&quot;O2&quot;) #include &amp;lt;bits/stdc++.h&amp;gt; #include &amp;lt;ext/rope&amp;gt; using namespace std; using nam原创 2018-09-01 10:12:50 · 258 阅读 · 0 评论