大意: 给定序列, 求划分为一个严格递增子序列和一个严格递减子序列, 可以为空. 跟 125D 类似的一个题, 直接暴力dfs, 用当前序列长度来剪枝, 状态不会太多, 但是会被一些数据卡掉, 特判一下小数据时不剪枝. #include <iostream> #include <sstream> #include <algorithm> #include <cstdio> #include <math.h> #include <set>…
Two Merged Sequences 感觉是个垃圾题啊, 为什么过的人这么少.. dp[ i ][ 0 ]表示处理完前 i 个, 第 i 个是递增序列序列里的元素,递减序列的最大值. dp[ i ][ 1 ]表示处理完前 i 个, 第 i 个是递减序列序列里的元素,递增序列的最小值. 然后随便转移转移顺便记录一下路径就好啦. #include<bits/stdc++.h> #define LL long long #define fi first #define se second #de…
Problem  Codeforces #550 (Div3) - G.Two Merged Sequences Time Limit: 2000 mSec Problem Description Two integer sequences existed initially, one of them was strictly increasing, and another one — strictly decreasing. Strictly increasing sequence is a…
题意: 将一个序列分成两个序列,两个序列中元素的相对顺序保持和原序列不变,使得分出的两个序列一个严格上升,一个严格下降. 思路: 我们考虑每个元素都要进入其中一个序列. 那么我们维护一个上升序列和一个下降序列,对于当前元素$i$: 如果它只能确定的进入一个序列,那么就让它进入. 如果它一个序列也进不去,那么答案就是'NO'. 如果它两个序列都可以进去,那么判断它和后一个元素(如果存在的话)的关系,如果它后一个元素比它大,那么让它进去上升序列,否则进去下降序列. 考虑这样为什么是对的: 首先我们知…
题目:https://codeforces.com/problemset/problem/1144/G 题意: 将一个序列分成两个序列,两个序列中元素的相对顺序保持和原序列不变,使得分出的两个序列一个严格上升,一个严格下降. 思路: 对于第 i 个数 , 我们应该分析什么情况可以放入升序什么情况放入降序 : 最容易的情况就是第 i 个数只能放在特定的一个序列中 , 与都不能放在序列中也就是 NO 的情况 : 假如此时的 i 是可以放入升序与降序的时候 , 我们就用a[i]  与a[ i+1 ]…
Rock... Paper! After Karen have found the deterministic winning (losing?) strategy for rock-paper-scissors, her brother, Koyomi, comes up with a new game as a substitute. The game works as follows. A positive integer n is decided first. Both Koyomi a…
今天,开博客,,,激动,第一次啊 嗯,,先来发水题纪念一下 D1. Magic Powder - 1   This problem is given in two versions that differ only by constraints. If you can solve this problem in large constraints, then you can just write a single solution to the both versions. If you fin…
Adieu l'ami. Koyomi is helping Oshino, an acquaintance of his, to take care of an open space around the abandoned Eikou Cram School building, Oshino's makeshift residence. The space is represented by a rectangular grid of n × m cells, arranged into n…
It's hard times now. Today Petya needs to score 100 points on Informatics exam. The tasks seem easy to Petya, but he thinks he lacks time to finish them all, so he asks you to help with one.. There is a glob pattern in the statements (a string consis…
Polycarp watched TV-show where k jury members one by one rated a participant by adding him a certain number of points (may be negative, i. e. points were subtracted). Initially the participant had some score, and each the marks were one by one added…