02 2017 档案

摘要:Description It's dinner time, and the cows are out in their separate pastures. Farmer John rings the bell so they will start walking to the barn. Your 阅读全文
posted @ 2017-02-28 22:56 Robin! 阅读(125) 评论(0) 推荐(0) 编辑
摘要:Description The citizens of Bytetown, AB, could not stand that the candidates in the mayoral election campaign have been placing their electoral poste 阅读全文
posted @ 2017-02-28 20:05 Robin! 阅读(109) 评论(0) 推荐(0) 编辑
摘要:Description 三国时期,南蛮王孟获叛乱,诸葛亮起兵平乱。当深入南蛮之地时,遇当地人绘得地图,发现各地分别由各个寨主据守,若诸葛亮想兵分多路进军,尽快占领各个山寨(必须占领所有山寨),并且最终所有士兵都汇聚到孟获所在山寨,若给你一次穿越的机会,你用程序告诉诸葛亮最少需要多少天才能完成这个任务 阅读全文
posted @ 2017-02-27 23:04 Robin! 阅读(128) 评论(0) 推荐(0) 编辑
摘要:Description Bessie is out in the field and wants to get back to the barn to get as much sleep as possible before Farmer John wakes her for the morning 阅读全文
posted @ 2017-02-27 19:01 Robin! 阅读(352) 评论(0) 推荐(0) 编辑
摘要:Problem Description The Head Elder of the tropical island of Lagrishan has a problem. A burst of foreign aid money was spent on extra roads between vi 阅读全文
posted @ 2017-02-27 17:20 Robin! 阅读(139) 评论(0) 推荐(0) 编辑
摘要:Problem Description 有N个比赛队(1<=N<=500),编号依次为1,2,3,。。。。,N进行比赛,比赛结束后,裁判委员会要将所有参赛队伍从前往后依次排名,但现在裁判委员会不能直接获得每个队的比赛成绩,只知道每场比赛的结果,即P1赢P2,用P1,P2表示,排名时P1在P2之前。现 阅读全文
posted @ 2017-02-26 22:49 Robin! 阅读(192) 评论(0) 推荐(0) 编辑
摘要:Description 给出N个数,求第a个数到第b个数之间最大的数减去最小的数的结果 Input N(N小于100,000),M(M小于100,000)接下来有N个数接下来M组范围,所有数均在[0,231-1]内每个范围有2个整数a,b(1<=a<=b<=N) Output 每行输出一个结果 Sa 阅读全文
posted @ 2017-02-23 14:59 Robin! 阅读(158) 评论(0) 推荐(0) 编辑
摘要:Description 顺利潜入勺林寺几天后,方丈给了西瓜一个光荣而艰巨的任务——打扫寺庙中的道路。同时给了西瓜一张勺林寺的地图。西瓜这才知道,勺林寺中总共有n座房子,但道路只有n-1条,这n-1条道路连接了寺中的所有房子,即保证在任何两座房子都能沿着道路抵达。好在西瓜人缘不错,他知道每座房子中都有 阅读全文
posted @ 2017-02-23 00:24 Robin! 阅读(160) 评论(0) 推荐(0) 编辑
摘要:Problem Description Nowadays, we all know that Computer College is the biggest department in HDU. But, maybe you don't know that Computer College had 阅读全文
posted @ 2017-02-21 23:31 Robin! 阅读(139) 评论(0) 推荐(0) 编辑
摘要:Problem Description In the game of DotA, Pudge’s meat hook is actually the most horrible thing for most of the heroes. The hook is made up of several 阅读全文
posted @ 2017-02-21 17:58 Robin! 阅读(203) 评论(0) 推荐(0) 编辑
摘要:1 #include 2 using namespace std; 3 #define M(a, b) memset(a, b, sizeof(a)); 4 const int maxn = 1000 + 10; 5 6 struct AhoCorasickAutomata { 7 int ch[maxn][26], val[maxn], last[maxn], f[ma... 阅读全文
posted @ 2017-02-20 20:41 Robin! 阅读(499) 评论(0) 推荐(0) 编辑
摘要:Problem Description A lot of battleships of evil are arranged in a line before the battle. Our commander decides to use our secret weapon to eliminate 阅读全文
posted @ 2017-02-20 17:36 Robin! 阅读(199) 评论(0) 推荐(0) 编辑
摘要:Problem Description 很多学校流行一种比较的习惯。老师们很喜欢询问,从某某到某某当中,分数最高的是多少。这让很多学生很反感。不管你喜不喜欢,现在需要你做的是,就是按照老师的要求,写一个程序,模拟老师的询问。当然,老师有时候需要更新某位同学的成绩。 Input 本题目包含多组测试,请 阅读全文
posted @ 2017-02-18 22:40 Robin! 阅读(145) 评论(0) 推荐(0) 编辑
摘要:Problem Description A group of researchers are designing an experiment to test the IQ of a monkey. They will hang a banana at the roof of a building, 阅读全文
posted @ 2017-02-17 22:01 Robin! 阅读(140) 评论(0) 推荐(0) 编辑
摘要:Problem Description C国的死对头A国这段时间正在进行军事演习,所以C国间谍头子Derek和他手下Tidy又开始忙乎了。A国在海岸线沿直线布置了N个工兵营地,Derek和Tidy的任务就是要监视这些工兵营地的活动情况。由于采取了某种先进的监测手段,所以每个工兵营地的人数C国都掌握的 阅读全文
posted @ 2017-02-17 21:01 Robin! 阅读(103) 评论(0) 推荐(0) 编辑
摘要:模板1:点修改:支持查询,更新; 1 #include<bits/stdc++.h> 2 using namespace std; 3 #define INF 0x3f3f3f3f 4 const int maxn = 1000 + 10; 5 int a[maxn], qL, qR, p, v; 阅读全文
posted @ 2017-02-16 22:05 Robin! 阅读(132) 评论(0) 推荐(0) 编辑
摘要:Description "Help Jimmy" 是在下图所示的场景上完成的游戏。 场景中包括多个长度和高度各不相同的平台。地面是最低的平台,高度为零,长度无限。 Jimmy老鼠在时刻0从高于所有平台的某处开始下落,它的下落速度始终为1米/秒。当Jimmy落到某个平台上时,游戏者选择让它向左还是向右 阅读全文
posted @ 2017-02-16 14:47 Robin! 阅读(168) 评论(0) 推荐(0) 编辑
摘要:思路: 求出每个状态i(已杀死机器人集合)能杀死的机器人数kill[i],即已死机器人的武器加上初始武器又能杀死的机器人的集合; 每个状态i都只能往包含在kill[i]中,且不包含在s中的机器人j扩展,即i -> i|(1 << j); dp[i]代表到达该状态的顺序总数,i等于所有前一个合法状态的 阅读全文
posted @ 2017-02-14 23:24 Robin! 阅读(293) 评论(0) 推荐(0) 编辑
摘要:思路:这题的难点在于判断是否该数是平衡数,解决方法是枚举力矩o的位置,计算每一位n累加的(n-o)*i的值是否等于0。 Code: 阅读全文
posted @ 2017-02-13 22:41 Robin! 阅读(274) 评论(0) 推荐(0) 编辑
摘要:思路: 正反各求出每个数作为结尾数字的LIS,然后找出最长的Wavio Sequence,用O(n2)试了一次TLE,所以只能用O(nlogn)的算法。 Code: 阅读全文
posted @ 2017-02-13 21:24 Robin! 阅读(186) 评论(0) 推荐(0) 编辑
摘要:题目链接:https://vjudge.net/problem/UVA-1220 思路: 树形DP模板题,求最大人数很简单,难点在于如何判断最大人数的名单是否有不同的情况; 解决方法是用一个数组f[manx][2]记录该节点是否出场的情况,为真时代表有多种情况; 具体讨论: Code: 阅读全文
posted @ 2017-02-06 22:58 Robin! 阅读(205) 评论(0) 推荐(0) 编辑
摘要:题目链接:https://vjudge.net/problem/UVA-10003 思路: 石子合并问题的逆过程,做法一模一样; Code: 阅读全文
posted @ 2017-02-06 16:11 Robin! 阅读(121) 评论(0) 推荐(0) 编辑
摘要:Problem Description The TV shows such as You Are the One has been very popular. In order to meet the need of boys who are still single, TJUT hold the 阅读全文
posted @ 2017-02-04 21:46 Robin! 阅读(246) 评论(0) 推荐(0) 编辑
摘要:Problem Description There is going to be a party to celebrate the 80-th Anniversary of the Ural State University. The University has a hierarchical st 阅读全文
posted @ 2017-02-03 02:03 Robin! 阅读(182) 评论(0) 推荐(0) 编辑
摘要:题目: The cows have purchased a yogurt factory that makes world-famous Yucky Yogurt. Over the next N (1 <= N <= 10,000) weeks, the price of milk and lab 阅读全文
posted @ 2017-02-02 01:55 Robin! 阅读(153) 评论(0) 推荐(0) 编辑
摘要:题目: Oh those picky N (1 <= N <= 50,000) cows! They are so picky that each one will only be milked over some precise time interval A..B (1 <= A <= B <= 阅读全文
posted @ 2017-02-01 21:23 Robin! 阅读(153) 评论(0) 推荐(0) 编辑
摘要:1 #include 2 using namespace std; 3 int MOD; 4 5 int fast_pow_mod(int a, int b) { 6 int res = 1; 7 while(b) { 8 if (b & 1) res = res * a % MOD; 9 a = a * a % MOD; 10... 阅读全文
posted @ 2017-02-01 01:54 Robin! 阅读(852) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示