codeforces --- 279C Ladder】的更多相关文章

C. Ladder time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output You've got an array, consisting of n integers a1, a2, ..., an. Also, you've got m queries, the i-th query is described by two inte…
题目链接:http://codeforces.com/problemset/problem/279/C 题意: 给出 $n$ 个整数 $a[1 \sim n]$,$m$ 个查询,对于一个查询 $[l_i,r_i]$,对应于子段 $a[l_i], a[l_i+1], \cdots, a[r_i]$,需要你判断这个子段是不是单峰的. 此处的单峰,指的是,开始时是一段单调不减的,然后以一段单调不增结束:同时这两段的长度为零也是可以的. 题解: 令 $f[i]$ 表示第 $i$ 个整数往前走,保持单调不…
题意:给定一个序列,每次一个询问,问某个区间是不是先增再降的. 析:首先先取处理以 i 个数向左能延伸到哪个数,向右能到哪个数,然后每次用RQM来查找最大值,分别向两边延伸,是否是覆盖区间. 代码如下: #pragma comment(linker, "/STACK:1024000000,1024000000") #include <cstdio> #include <string> #include <cstdlib> #include <c…
[链接] 我是链接,点我呀:) [题意] 题意 [题解] 设pre[i]表示i往前一直递增能递增多远 设aft[i]表示i往后一直递增能递增多远 如果aft[l]+pre[r]>=(r-l+1)那么就ok否则no [代码] import java.io.*; import java.util.*; public class Main { static InputReader in; static PrintWriter out; public static void main(String[]…
A. Vicious Keyboard time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Tonio has a keyboard with only two letters, "V" and "K". One day, he has typed out a string s with only t…
上一次我们拿学校的URP做了个小小的demo.... 其实我们还可以把每个学生的证件照爬下来做成一个证件照校花校草评比 另外也可以写一个物理实验自动选课... 但是出于多种原因,,还是绕开这些敏感话题.. 今天,我们来扒一下cf的题面! PS:本代码不是我原创 1. 必要的分析 1.1 页面的获取 一般情况CF的每一个 contest 是这样的: 对应的URL是:http://codeforces.com/contest/xxx 还有一个Complete problemset页面,它是这样的:…
Given two words (beginWord and endWord), and a dictionary, find the length of shortest transformation sequence from beginWord to endWord, such that: Only one letter can be changed at a time Each intermediate word must exist in the dictionary For exam…
Given two words (start and end), and a dictionary, find all shortest transformation sequence(s) from start to end, such that: Only one letter can be changed at a time Each intermediate word must exist in the dictionary For example, Given: start = "hi…
http://codeforces.com/contest/738/problem/D Galya is playing one-dimensional Sea Battle on a 1 × n grid. In this game a ships are placed on the grid. Each of the ships consists of bconsecutive cells. No cell can be part of two ships, however, the shi…
http://codeforces.com/contest/738/problem/C Vasya is currently at a car rental service, and he wants to reach cinema. The film he has bought a ticket for starts in t minutes. There is a straight road of length s from the service to the cinema. Let's…