题目链接:https://cn.vjudge.net/problem/Gym-102072H 题目大意:中文题目 具体思路:通过两棵线段树来维护,第一棵线段树来维护当前坐标的点的日增长速度(默认每一年的增长速度都是当前年份的增长速度),对于第一棵线段树,肯定会存在多算的情况,那么我们第二棵线段树就维护每一个点的多算的情况就可以了. 举个例子:当前的n只有1,初始值也是1, 三个操作,第一年加一个,第二年加一个,第三年加一个.然后问你第四年的当前的个数.在第二年的时候增长速度还是1,第三年的增加速…
题目链接:http://codeforces.com/gym/101466/problem/K 题目: 题意: 给你一棵有n个节点的树,根节点始终为0,有两种操作: 1.RAND:查询以u为根节点的子树上的所有节点的权值的乘积x,及x的因数个数. 2.SEED:将节点u的权值乘以x. 思路: 比赛时少看了因数不大于13这句话,然后本题难度增加数倍,肝了两个小时都没肝出来,对不起队友啊,今天的组队训练赛实力背锅…… 这题一眼线段树,由于是对一棵子树进行处理,因此我们采用常规套路,借助dfs序将子树…
Judge Bahosain was bored at ACM AmrahCPC 2016 as the winner of the contest had the first rank from the second hour until the end of the contest. Bahosain is studying the results of the past contests to improve the problem sets he writes and make sure…
Flipping Parentheses 题目连接: http://codeforces.com/gym/100803/attachments Description A string consisting only of parentheses '(' and ')' is called balanced if it is one of the following. • A string "()" is balanced. • Concatenation of two balance…
Intervals 题目连接: http://codeforces.com/gym/100231/attachments Description 给你n个区间,告诉你每个区间内都有ci个数 然后你需要找一个最小的点集,使得满足这n个区间的条件 Input n 然后li,ri,ci Output 输出最小点集大小 Sample Input 5 3 7 3 8 10 3 6 8 1 1 3 1 10 11 1 Sample Output 6 Hint 题意 题解: 线段树+二分+贪心 首先我们贪心一…
F. Ilya Muromets Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/gym/100513/problem/F Description I Ilya Muromets is a legendary bogatyr. Right now he is struggling against Zmej Gorynych, a dragon with n heads numbered from 1 to nf…
D. Selection Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/gym/100114 Description When selecting files in an application dialog, Vasya noted that he can get the same selection in different ways. A simple mouse click selects a sing…
题目链接: http://codeforces.com/gym/100526 http://acm.hunnu.edu.cn/online/?action=problem&type=show&id=11668&courseid=0 题目大意: N个人,每个人有三个能力排名X Y Z,每种能力没有同名次,如果当前的人比在清单上的人中至少有一项能力都要优,则这个人也会被加到清单上. 求最终清单上有几个人.(N<=100000) 题目思路: [线段树] 首先按第三关键字排序,确定一…
Summer WarsTime Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://acm.hust.edu.cn/vjudge/contest/view.action?cid=88994#problem/J Description The mafia is finally resting after a year of hard work and not so much money. Mafianca, the little mascot of the…
Consider a directed graph G of N nodes and all edges (u→v) such that u < v. It is clear that this graph doesn't contain any cycles. Your task is to find the lexicographically largest topological sort of the graph after removing a given list of edges.…