A. Minimum Difficulty time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Mike is trying rock climbing but he is awful at it. There are n holds on the wall, i-th hold is at height ai off the g…
A. Minimum Difficulty time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Mike is trying rock climbing but he is awful at it. There are n holds on the wall, i-th hold is at height ai off the g…
题目传送门 /* 题意:删除若干行,使得n行字符串成递增排序 暴力+构造:从前往后枚举列,当之前的顺序已经正确时,之后就不用考虑了,这样删列最小 */ /************************************************ Author :Running_Time Created Time :2015-8-3 10:49:53 File Name :C.cpp *************************************************/ #in…
题目传送门 /* 构造+暴力:按照题目意思,只要10次加1就变回原来的数字,暴力枚举所有数字,string大法好! */ /************************************************ Author :Running_Time Created Time :2015-8-3 8:43:02 File Name :A.cpp *************************************************/ #include <cstdio>…
解题思路:给出一个递增数列,a1,a2,a3,-----,an.问任意去掉a2到a3之间任意一个数之后, 因为注意到该数列是单调递增的,所以可以先求出原数列相邻两项的差值的最大值max, 得到新的一个数列(比如先去掉a2),该数列相邻两项的差值的最大值为Max1=findmax(max,a3-a1) 再去掉 a3,得到该数列相邻两项的差值的最大值Max2=findmax(max,a4-a2) ------ 再去掉 an-1,得到该数列相邻两项的差值的最大值Maxn-2=findmax(max,a…
A. Minimum Difficulty time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Mike is trying rock climbing but he is awful at it. There are n holds on the wall, i-th hold is at height ai off the g…
A:暴力弄就好,怎么方便怎么来. B:我们知道最多加10次, 然后每次加1后我们求能移动的最小值,大概O(N)的效率. #include<bits/stdc++.h> using namespace std; #define inf 0x3f3f3f #define N 1234567 string pan(string s)//求能移动的最小字符串 { string tmp=s; ;i<s.size();i++) { string k=""; ;j<s.siz…
D. Minimum number of steps time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output We have a string of letters 'a' and 'b'. We want to perform some operations on it. On each step we choose one of s…
C. Removing Columns time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output You are given an n × m rectangular table consisting of lower case English letters. In one operation you can completely r…
一 题面 E. Minimum Array 二 分析 注意前提条件:$0 \le  a_{i} \lt n$ 并且 $0 \le  b_{i} \lt n$.那么,我们可以在$a_{i}$中任取一个数进行分析,发现为满足字典序最小,在$b$中找到$n-a_{i}$就是最优解. 接下来分析$b$,在$b$中是不一定找得到$n-a_{i}$的.所以需要分析如何找到此情况下的最优解. 假设$a_{i} = 3$,$n = 4$,那么$b_{i}$对应的最优情况是$b_{i} = 1$,可以把所有$b_…