Problem UVA11846-Finding Seats Again Accept: 69 Submit: 433Time Limit: 10000 mSec Problem Description A set of n2 computer scientists went to the movies. Fortunately, the theater they chose has a square layout: n rows, each one with n seats. Howev
Petrozavodsk Summer Training Camp 2017 Day 9 Problem A. Building 题目描述:给出一棵树,在树上取出一条简单路径,使得该路径的最长上升子序列最长,问最长的长度. solution 最常见的想法就是树状dp,但空间不太够,所以选择直接计数. 每个点记住两个\(vector(f, g)\),\(f_i\)表示从叶子到\(i\)的最长的递增序列,\(g_i\)表示从叶子到\(i\)的最长的递减序列. 当算以\(i\)为根的子树的答案时,假设
#423 Div2 C 题意 给出 n 个字符串以及他们在 S 串中出现的位置,求字典序最小的 S 串.保证给出的字符串不会冲突. 分析 模拟就好.用并查集思想优化,数组 nxt[i] 表示从 i 开始 接下来还未填字母的第一个位置.初始化 nxt[i] = i. code #include<bits/stdc++.h> using namespace std; typedef long long ll; const int MAXN = 1e5 + 5; const int N = 2e6