摘要:http://hihocoder.com/problemset/problem/1309 题目大意是给定n个任务的起始时间,求问最少需要多少台机器。 有一个贪心的策略就是,如果说对于一个任务结束,必然接一个开始时间最接近这个的比较合算。我们假想一个任务池,那么任务池中最早结束的那个,必然接剩余任务中
阅读全文
摘要:这是我的第一次打TC,感觉打的一般般吧。不过TC的题目确实挺有意思的。 由于是用客户端打的,所以就不发题目地址了。 300分的题: 这题大意是有一段序列只包含+和数字0~9。 一段序列的操作是,从头扫到尾,遇到+就对计数器+1。遇到数字就计算abs(num-count)的值,并加到sum中。 题目要
阅读全文
摘要:http://codeforces.com/contest/676 在allzysyz学弟和hqwhqwhq的邀请下,打了我的第三场CF。。。 毕竟在半夜。。所以本来想水到12点就去睡觉的。。。结果一下次过了三题,发现第四题是个bfs,就打到了12:30.。。。BC貌似是没有了,不知道后面还会不会有
阅读全文
摘要:题目链接:http://gdutcode.sinaapp.com/problem.php?cid=1031&pid=3 这算是一个胡搞类型的题目。当然肯定是有其数据结构支撑的。 唯一的限制就是不能出现连续的两个’#’。 因为如果我从左到右构造这棵树,那么假设我构造到第i个, 如果i+1是数字,那么把
阅读全文
摘要:题目链接:https://icpcarchive.ecs.baylor.edu/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=5159题目大意是就是n个人进行两两的比赛,胜一局得A分,平局B分,败局C分。然后取...
阅读全文
摘要:题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5536题目大意是给了一个序列,求(si+sj)^sk的最大值。首先n有1000,暴力理论上是不行的。此外题目中说大数据只有10组,小数据最多n只有100。(那么c*n^2的复杂度应该差不多)于是可以考虑枚...
阅读全文
摘要:题目链接:http://poj.org/problem?id=3764题目大意是在树上求一条路径,使得xor和最大。由于是在树上,所以两个结点之间应有唯一路径。而xor(u,v)=xor(0,u)^xor(0,v)。所以如果预处理出0结点到所有结点的xor路径和,问题就转换成了求n个数中取出两个数,...
阅读全文
摘要:题目链接:http://acm.csu.edu.cn/OnlineJudge/problem.php?id=1216题目大意是给了n个数,然后取出两个数,使得xor值最大。首先暴力枚举是C(n,2),显然不行。考虑每一个数,显然,从最高位开始,如果它能和某一个数xor,让最高位为1,效果肯定是最佳的...
阅读全文
摘要:Description在山上一共有N个站点需要检查,检查员从山顶出发去各个站点进行检查,各个站点间有且仅有一条通路,检查员下山前往站点时比较轻松,而上山时却需要额外的时间,问最后检查员检查完所有站点时所需要的额外时间最少是多少。Input包含多组数据 每组数据输入第一行为一个整数N 表示站点个数(1...
阅读全文
摘要:Problem DescriptionEzio Auditore is a great master as an assassin. Now he has prowled in the enemies’ base successfully. He finds that the only weapon...
阅读全文
摘要:Problem DescriptionAs we know, Rikka is poor at math. Yuta is worrying about this situation, so he gives Rikka some math tasks to practice. There is o...
阅读全文
摘要:DescriptionPog and Szh are playing games.There is a sequence with $n$ numbers, Pog will choose a number A from the sequence. Szh will choose an anothe...
阅读全文
摘要:DescriptionFat brother and Maze are playing a kind of special (hentai) game in the playground. (Maybe it’s the OOXX game which decrypted in the last p...
阅读全文
摘要:DescriptionDoctor Ghee is teaching Kia how to calculate the sum of two integers. But Kia is so careless and alway forget to carry a number when the su...
阅读全文
摘要:Description尼克发明了这样一个游戏:在一个坐标轴上,有一些圆,这些圆的圆心都在x轴上,现在给定一个x轴上的点,保证该点没有在这些圆内(以及圆上),尼克可以以这个点为圆心做任意大小的圆,他想知道自己做多可以与多少个给定的圆相交(相切也算,包含不算)。Input输入有多组数据 输入到文件尾每一...
阅读全文
摘要:DescriptionA group of N people wishes to go across a river with only one boat, which can at most carry two persons. Therefore some sort of shuttle arr...
阅读全文
摘要:Description Farmer John is assigning some of his N (1 #include #include #include #include #include #include #include #include #include #include #defin...
阅读全文
摘要:DescriptionThere is a special number sequence which has n+1 integers. For each number in sequence, we have two rules:● ai∈ [0,n]● ai≠ aj( i ≠ j )For s...
阅读全文