B. Jumping Jack 题目连接: http://www.codeforces.com/contest/11/problem/B Description Jack is working on his jumping skills recently. Currently he's located at point zero of the number line. He would like to get to the point x. In order to train, he has d…
A. Increasing Sequence 题目连接: http://www.codeforces.com/contest/11/problem/A Description A sequence a0, a1, ..., at - 1 is called increasing if ai - 1 < ai for each i: 0 < i < t. You are given a sequence b0, b1, ..., bn - 1 and a positive integer…
[题目链接] https://codeforces.com/contest/620/problem/E [算法] 显然 , 一棵子树的DFS序必然为连续的一段 用线段树维护颜色数即可 [代码] #include<bits/stdc++.h> using namespace std; ; struct edge { int to , nxt; } e[MAXN << ]; int n , m , tot , timer; int a[MAXN],dfn[MAXN],pos[MAXN]…
题目链接:https://codeforces.com/contest/1427/problem/C 题意 \(r\) 行与 \(r\) 列相交形成了 \(r \times r\) 个点,初始时刻记者位于左下角的 \((1,1)\) 处,接下来给出 \(n\) 个名人的出现时间和位置,出现时间严格递增,问记者最多可以拍到多少名人的照片. 题解 This is a classical dynamic-programming task with a twist. 这是一个有些变化的经典动态规划问题.…