1.J题:给你T组数据,每一组数据给你一个区间,让你求这个区间的范围,区间的起始时间和终止时间可能被包含或重复 思路:思路的话,就是直接把给定的两个区间的之间的数包括端点存到vector去重,然后直接输出个数即可,或者直接存到set里直接系统去重也可 #include <iostream> #include <cstring> #include <algorithm> #include <vector> using namespace std; vector…
题面 题意:给你n个集合,每个集合有L到R这些种类的邮票,让你选择其中的K个集合,使得最后选择的邮票种类尽可能多,N,L,R都<=2000 题解:容易乱想到网络流,可是再细想一下就会发现处理不了这种模型的 然后看数据范围,想到dp,定义状态f[i][j]表示前i个集合选j个的最多种类, 我们发现这需要N^3,因为每次除了枚举i,j还要枚举一个q,来记录新的一个集合是从上次的哪一个集合拓展覆盖来的 苦思不得其解,看全场都a了,终于在最后1h改了状态(打的当然是重现赛) 我们发现L,R也只有2000…
点击传送 Alice’s Stamps Time Limit: 6000/3000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 1448    Accepted Submission(s): 501 Problem Description Alice likes to collect stamps. She is now at the post office buying so…
G. You're a Professional 题目连接: http://www.codeforces.com/contest/656/problem/G Description A simple recommendation system would recommend a user things liked by a certain number of their friends. In this problem you will implement part of such a syst…
In an unprecedented turn of events, goblins recently launched an invasion against the Nedewsian city of Mlohkcots. Goblins—small, green critters—love nothing more than to introduce additional entropy into the calm and ordered lives of ordinary people…
Rigid Frameworks Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 337    Accepted Submission(s): 273 Problem Description Erik Demaine is a Professor in Computer Science at the Massachusetts Insti…
地址:http://acm.uestc.edu.cn/#/problem/show/1564 题目: G - GC?(X,Y) Time Limit: 3000/1000MS (Java/Others)     Memory Limit: 131071/131071KB (Java/Others) One positive integer can be represented by the product of some prime numbers. Sort the prime numbers…
题目来源:http://codeforces.com/group/aUVPeyEnI2/contest/229669 时间限制:1s 空间限制:64MB 题目大意:给定n,a,b的值 求一个长度为n的由1和2组成的数列,要求数列中最多有a个连续的1和b个连续的2,问由多少种不同的数列 样例: 题目解法: 动态规划,使用一个二维数组,dp[i][1]代表当前位为1的前i个数的排列个数,dp[i][2]代表当前位为2的前i个数的排列个数 代码: #include <bits/stdc++.h> #…
链接 G题 https://codeforces.com/gym/102082 使其成为单峰序列需要交换多少次相邻的数. 树状数组维护逆序对. 对于每个序列中的数,要么在单峰的左侧,要么在单峰的右侧,所以从左边开始维护每个数相对于左侧的逆序对数量,从右边开始维护每个数相对于右侧的逆序对数量.取小加入答案即可. #include <bits/stdc++.h> #define debug(x) cout << #x << ": " << x…
题目 你有\(n\)个士兵,需要将他们分成\(m\)组,每组可以为0: 现在这些士兵要去攻打\(m\)个敌人,每个敌人的生命值为\(hp_i\) : 一轮游戏中一组士兵选定一个攻打的敌人,敌人生命值-=这组的人数: 胜利的判定是所有敌人的生命值为非正的: 输出胜利的最小轮数,可以达到最小轮数的分配方式,并输出每轮的策略: \(1 \le m \le n \le 10^6 \ , \ 1 \le \sum hp_i \le 10^6\) ; 题解 答案的下界是\(\lceil \frac{\sum…