题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4553 题目大意:就是有三种操作: ①DS x,安排一段长度为x的空闲时间跟屌丝一起,输出这段时间的起点,若没有则输出“fly with yourself”. ②NS x,安排一段长度为x的空闲时间跟女神在一起,若没有则可以无视屌丝的时间再找一次,输出这段时间的起点,若两次都没有则输出“wait for me”. ③STUDY!! l r,清空l~r这段时间的所有安排. 解题思路:区间合并问题,但是要…
约会安排 http://acm.hdu.edu.cn/showproblem.php?pid=4553 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65535/32768 K (Java/Others) Problem Description 寒假来了,又到了小明和女神们约会的季节. 小明虽为屌丝级码农,但非常活跃,女神们常常在小明网上的大段发言后热情回复“呵呵”,所以,小明的最爱就是和女神们约会.与此同时,也有很多基友找他开黑…
题目大意: 就是给定一堆位置,进行删除还原,最后找到 t 位置上的最大连续位置 #include <cstdio> #include <cstring> #include <iostream> using namespace std; ; struct Node{ int l , r , ml , mr , ma; //ml左最长,mr右最长,ma总最长 }tree[N<<]; void build(int o , int l , int r) { tree…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5029 Problem Description The soil is cracking up because of the drought and the rabbit kingdom is facing a serious famine. The RRC(Rabbit Red Cross) organizes the distribution of relief grain in the disa…
Dylans loves tree Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 1444 Accepted Submission(s): 329 Problem Description Dylans is given a tree with N nodes. All nodes have a value A[i].Nodes…