题目链接 Educational Codeforces Round 22 Problem E 题意 给定一个序列,$q$次查询,询问从$l$到$r$中出现过的数字的出现次数和$k$取较小值后的和 设$f(i, 1)$表示满足$a_{j} = a_{i}$并且$j < i$的$j$的最大值,若不存在这 ...
分类:
其他好文 时间:
2018-03-22 01:45:25
阅读次数:
160
813E - Army Creation 思路: 线段树+二分 先预处理每个点往后走k步的下标 线段树二叉树的每个节点用vector维护这些下标,给这些下标排个序 询问区间L,R,那么把下标小于等于R的位置都减掉,因为只要后面连续k个就够了 代码: ...
分类:
其他好文 时间:
2018-03-07 21:42:59
阅读次数:
200
题意概述: 给出一棵N个结点的树,然后有M个居民分散在这棵树的结点上(允许某个结点没有居民)。现在给出一些询问形如u,v,a,定义k=min(x,a),其中x表示的是u->v路径上的居民数量。将所有路径上的居民编号升序排列之后得到序列p1,p2,...,px,要求对于每一组询问,输出k,p1,p2... ...
分类:
其他好文 时间:
2018-02-22 21:31:42
阅读次数:
177
Description An army of ants walk on a horizontal pole of length l cm, each with a constant speed of 1 cm/s. When a walking ant reaches an end of the p ...
分类:
其他好文 时间:
2018-02-19 17:01:36
阅读次数:
170
Ants Time Limit: 1000MS Memory Limit: 30000K Total Submissions: 21604 Accepted: 8858 Description An army of ants walk on a horizontal pole of length l ...
分类:
其他好文 时间:
2018-02-14 12:24:31
阅读次数:
149
The army of United Nations launched a new wave of air strikes on terrorist forces. The objective of the mission is to reduce enemy’s logistical mobili ...
分类:
其他好文 时间:
2018-01-30 16:53:01
阅读次数:
164
【CF883B】Berland Army 题意:给出n个点,m条有向边,有的点的点权已知,其余的未知,点权都在1-k中。先希望你确定出所有点的点权,满足: 对于所有边a->b,a的点权>b的点权对于i=1..k,至少有一个点的点权为i n,m,k<=100000 题解:像菜肴制作一样奇怪的拓扑排序题 ...
分类:
编程语言 时间:
2017-12-24 12:47:50
阅读次数:
147
题意 : 这个题是说给你n个点,然后让你标记其中尽可能少的点,使得n个点都处于被标记点左右不超过R的区间内 分析 : #include<bits/stdc++.h> using namespace std; const int maxn = 1e3 + 10; int arr[maxn]; int ...
分类:
其他好文 时间:
2017-11-30 23:26:14
阅读次数:
141
Windy has a country, and he wants to build an army to protect his country. He has picked up N girls and M boys and wants to collect them to be his sol ...
分类:
其他好文 时间:
2017-11-16 20:55:10
阅读次数:
138
Ants Time Limit: 1000MS Memory Limit: 30000K Total Submissions: 20047 Accepted: 8330 Description An army of ants walk on a horizontal pole of length l ...
分类:
其他好文 时间:
2017-10-11 00:59:03
阅读次数:
216