URAL 1203. Scientific Conference(瞎搞)】的更多相关文章

题目链接 本来觉得这不是经典的贪心吗..果断水一次,wa了,看了看discuss,发现貌似不好水,土土的DP了一下,复杂度很高了,又T了...然后想想单调队列,二分什么的...不好往上加,直接搞了标记数组flag,暴力从大到小,遍历寻找,然后就过了...这算是优化吗,瞎搞... #include <cstring> #include <cstdio> #include <string> #include <iostream> #include <alg…
1203. Scientific Conference Time limit: 1.0 second Memory limit: 64 MB Functioning of a scientific conference is usually divided into several simultaneous sections. For example, there may be a section on parallel computing, a section on visualization…
Scientific Conference 之前一直在刷计算几何,邀请赛连计算几何的毛都买见着,暑假这一段时间就做多校.补多校的题目.刷一下一直薄弱的DP.多校假设有计算几何一定要干掉-.- 题意:给你N个报告会的開始时间跟结束时间.问你做多能够听几场报告会.要求报告会之间至少间隔为1. 思路:事实上是个活动安排问题.能够用贪心也能够用DP,贪心写起来会比較简单一些.由于练习DP,所以又用DP写了一遍. 贪心的话就是一个非常easy的活动选择问题,从结束时间入手,找每次的最优选择. 贪心: st…
http://acm.timus.ru/problem.aspx?space=1&num=1203 #include <cstdio> #include <cstring> #include <algorithm> #define maxn 400000 using namespace std; struct node { int s,e; bool operator <(const node &a)const { return ((e<a.…
http://acm.timus.ru/problem.aspx?space=1&num=1203 按照结束时间为主,开始时间为辅排序,那么对于任意结束时间t,在此之前结束的任务都已经被处理,从这个时间开始的任务都正要被处理, 因为t<=3e5,可以用简单dp解决 #include <cstdio> #include <algorithm> using namespace std; const int maxn=1e5+5; int n; typedef pair&l…
题目:click here 分明就是贪心怎么会在dp的专题 #include <bits/stdc++.h> using namespace std; typedef unsigned long long ll; const int INF = 0x3f3f3f3f; ; struct Node { int F, S; bool operator < ( const Node x ) const { return S < x.S; } } p[M]; int n; int main…
Problem H. Horrible Truth Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/gym/100610 Description In a Famous TV Show “Find Out” there are n characters and only one Horrible Truth. To make the series breathtaking all way long, the sc…
链接:https://www.nowcoder.com/acm/contest/104/B来源:牛客网 题意:A few days ago, WRD was playing a small game called Salty Fish Go. We can simplify the rules of the game as follows. 给你v,l,n,m代表有v个速度,下一行分别给出v个速度,l长的路,n个随机地点随机改变速度的加油站,m个随机地点宝藏.问拿到所有宝藏的时间期望. 题解:瞎…
题目链接:点我 题意:给定一个序列,询问是否能删除一个数让它成为非递减或者非递增的序列. 比如说 删除后的序列是1 3 3 5 或者5 3 3 1 或者1 3 5 或者5 3 1 都可以.只要满足删掉某个数,构成非递减或者非递增,就输出YES,如果不能就输出NO 正解(LIS求最长上升子序列): 正着来一遍,反着来一遍 注意要用upper_bound即可: 代码: #include<bits/stdc++.h> using namespace std; int Maxlen(int a[],i…
传送门 (<---可以点击的~) 时间限制(普通/Java):1000MS/3000MS     内存限制:65536KByte 描述 有些英语单词后缀都是一样的,现在我们需要从给定的一堆单词里面找出某个后缀的单词个数. 输入 输入有多组数据.每组第一行输入n,m,0<=n,m<=100000,第二行到n+1行:输入单词,每个单词仅有小写英文字母组成,长度不超过10.第n+2行到n+m+1行,输入要找的单词后缀. 输出 在n个单词里面找出输入单词后缀的单词个数,然后输出.每个数据与数据之…