04 2015 档案
timus 1225 flags 基础DP 简单递推
摘要:1225. FlagsTime limit: 1.0 secondMemory limit: 64 MBOn the Day of the Flag of Russia a shop-owner decided to decorate the show-window ... 阅读全文
posted @ 2015-04-27 22:28 _fukua 阅读(269) 评论(0) 推荐(0)
HDU 1081 to the max 基础DP 好题
摘要:To The MaxProblem DescriptionGiven a two-dimensional array of positive and negative integers, a sub-rectangle is any contiguous sub-... 阅读全文
posted @ 2015-04-27 20:20 _fukua 阅读(220) 评论(0) 推荐(0)
HDU 1025 Constructing Roads In JGShining's Kingdom   LIS 简单题 好题 超级坑
摘要:Constructing Roads In JGShining's KingdomProblem DescriptionJGShining's kingdom consists of 2n(n is no more than 500,000) small cities which are... 阅读全文
posted @ 2015-04-23 23:46 _fukua 阅读(243) 评论(0) 推荐(0)
HDU1158 Employment Planning 基础DP
摘要:Employment PlanningProblem DescriptionA project manager wants to determine the number of the workers needed in every month. He does know... 阅读全文
posted @ 2015-04-23 00:38 _fukua 阅读(254) 评论(0) 推荐(0)
HDU 1160 FatMouse's Speed 简单DP
摘要:FatMouse's SpeedProblem DescriptionFatMouse believes that the fatter a mouse is, the faster it runs. To disprove this, you want to ta... 阅读全文
posted @ 2015-04-22 18:39 _fukua 阅读(213) 评论(0) 推荐(0)
HDU 1224 Free DIY Tour 简单DP
摘要:Free DIY TourProblem DescriptionWeiwei is a software engineer of ShiningSoft. He has just excellently fulfilled a software project wit... 阅读全文
posted @ 2015-04-22 16:51 _fukua 阅读(310) 评论(0) 推荐(0)
HDU 2059 龟兔赛跑 基础DP 好题
摘要:龟兔赛跑Problem Description据说在很久很久以前,可怜的兔子经历了人生中最大的打击——赛跑输给乌龟后,心中郁闷,发誓要报仇雪恨,于是躲进了杭州下沙某农业园卧薪尝胆潜心修炼,终于练成了绝技,能够毫不休息得以恒定的速度(VR m/s)一直跑。兔子一直想找机会好... 阅读全文
posted @ 2015-04-22 13:22 _fukua 阅读(270) 评论(0) 推荐(0)
HDU 1422 重温世界杯 基础DP 好题
摘要:重温世界杯Problem Description世界杯结束了,意大利人连本带利的收回了法国人6年前欠他们的债,捧起了大力神杯,成就了4星意大利.世界杯虽然结束了,但是这界世界杯给我们还是留下许多值得回忆的东西.比如我们听到了黄名嘴的3分钟激情解说,我们懂得了原来可以向同一个人... 阅读全文
posted @ 2015-04-22 09:53 _fukua 阅读(231) 评论(0) 推荐(0)
基础DP中的二维费用的背包
摘要:二维费用的背包问题:指对于每件物品,具有2种不用的费用,选择这件物品需要同时付出2种代价对于每一种代价都有一个可付出的最大值(背包容量)问怎么样选择物品可以得到最大的价值设这2种代价分别为1,2第i件物品所需的2种代价为a[i] , b[i]2种代价可付出的最大值为U,V物品价值为w[i]费用增加了... 阅读全文
posted @ 2015-04-20 15:09 _fukua 阅读(247) 评论(0) 推荐(0)
中大周赛第7场 HASH 简单题
摘要:DescriptionSpies use attributes to disguise themselves to make sure that they are not recognized. For example, when putting on sunglasses, a spy sudde... 阅读全文
posted @ 2015-04-18 22:56 _fukua 阅读(264) 评论(0) 推荐(0)
POJ2236 Wireless Network 并查集 好题
摘要:Wireless NetworkDescriptionAn earthquake takes place in Southeast Asia. The ACM (Asia Cooperated Medical team) have set up a wireless networ... 阅读全文
posted @ 2015-04-17 20:57 _fukua 阅读(386) 评论(0) 推荐(0)
POJ1182 食物链 并查集 好题
摘要:食物链Description动物王国中有三类动物A,B,C,这三类动物的食物链构成了有趣的环形。A吃B, B吃C,C吃A。现有N个动物,以1-N编号。每个动物都是A,B,C中的一种,但是我们并不知道它到底是哪一种。有人用两种说法对这N个动物所构成的食物链关系进行描述:第一种... 阅读全文
posted @ 2015-04-17 00:08 _fukua 阅读(229) 评论(0) 推荐(0)
POJ1703 Find them, Catch them 并查集 好题 有坑点
摘要:DescriptionThe police office in Tadu City decides to say ends to the chaos, as launch actions to root up the TWO gangs in the city, Gang Dragon and Ga... 阅读全文
posted @ 2015-04-15 23:26 _fukua 阅读(288) 评论(0) 推荐(0)
Codeforces Round #299 (Div. 2)
摘要:A. Tavas and NafasToday Tavas got his test result as an integer score and he wants to share it with his girlfriend, Nafas.His phone operatin... 阅读全文
posted @ 2015-04-15 12:03 _fukua 阅读(244) 评论(0) 推荐(0)
HDU2610 Sequence one DFS 简单题 好题
摘要:Sequence oneProblem DescriptionSearch is important in the acm algorithm. When you want to solve a problem by using the search method, try... 阅读全文
posted @ 2015-04-13 18:27 _fukua 阅读(302) 评论(0) 推荐(0)
Codeforces Round #298 (Div. 2)
摘要:A. ExamAn exam fornstudents will take place in a long and narrow room, so the students will sit in a line in some order. The teacher suspect... 阅读全文
posted @ 2015-04-13 16:22 _fukua 阅读(304) 评论(0) 推荐(0)
个人总结
摘要:1.在用邻接矩阵存边时,要注意有重边的情况。2.double型用memset初始化貌似不可以,慎用memset3.用printf输出%的话要用%%.4.要注意判断有没有!=EOF,不然可能会tle。5.线段树区间更新的时候,update()和query() 都要调用pushdown()函数。 (做一... 阅读全文
posted @ 2015-04-12 00:38 _fukua 阅读(199) 评论(0) 推荐(0)
中大周赛15年第6场
摘要:13983. Milk SchedulingConstraintsTime Limit: 1 secs, Memory Limit: 256 MBDescriptionFarmer John has N cows that need to be milked (1 0) ... 阅读全文
posted @ 2015-04-12 00:29 _fukua 阅读(223) 评论(0) 推荐(0)
Codeforces Round #283 (Div. 2) 题解
摘要:A. Minimum DifficultyMike is trying rock climbing but he is awful at it.There arenholds on the wall,i-th hold is at heightaioff the ground. Be... 阅读全文
posted @ 2015-04-10 20:07 _fukua 阅读(321) 评论(0) 推荐(0)
HDU 1175 连连看 DFS 简单题
摘要:Problem Description“连连看”相信很多人都玩过。没玩过也没关系,下面我给大家介绍一下游戏规则:在一个棋盘中,放了很多的棋子。如果某两个相同的棋子,可以通过一条线连起来(这条线不能经过其它棋子),而且线的转折次数不超过两次,那么这两个棋子就可以在棋盘上消去。不好意思,由于我以前没有玩... 阅读全文
posted @ 2015-04-06 01:17 _fukua 阅读(339) 评论(0) 推荐(0)
HDU 1258 Sum It Up DFS 简单题 好题
摘要:给出一个数t,n,然后后面有n个数。问:从这n个数里面能不能挑出一些数,使得和为t,注意输出顺序。Sample Input4 6 4 3 2 2 1 1 5 3 2 1 1 400 12 50 50 50 50 50 50 25 25 25 25 25 25 0 0Sample OutputSums... 阅读全文
posted @ 2015-04-06 00:05 _fukua 阅读(262) 评论(0) 推荐(0)
HDU 1010 Tempter of the Bone DFS 简单题 注意剪枝
摘要:题意:一只小狗要刚好在t时刻从起点都到终点,问可不可以。注意剪枝。 1 #include 2 #include 3 #include 4 using namespace std; 5 int maze[9][9]; 6 bool vis[9][9]; 7 int n,m,t; 8 bool ans;... 阅读全文
posted @ 2015-04-05 22:28 _fukua 阅读(294) 评论(0) 推荐(0)
HDU1548 A strange lift BFS 简单题
摘要:一个电梯有n层,每一层有一个数k[i],和2个按钮,UP和DOWN,表示从这一层可以到达i+k[i] 或i-k[i] .给出a,b,问从a到b 最少需要按多少下按钮。直接bfs. 1 #include 2 #include 3 #include 4 using namespace std; 5 co... 阅读全文
posted @ 2015-04-05 15:25 _fukua 阅读(210) 评论(0) 推荐(0)
HDU 1253 胜利大逃亡 BFS 简单题
摘要:题意:Ignatius要从迷宫的(1,1,1)在时间t内跑到(a,b,c),问可不可能。(题目本来是从(0,0,0)跑到(a-1,b-1,c-1)的)简单的3维bfs加剪枝:a+b+c-3>t 速度会快不少。不过我这里没有加。Input输入数据的第一行是一个正整数K,表明测试数据的数量.每组测试数据... 阅读全文
posted @ 2015-04-05 14:33 _fukua 阅读(335) 评论(0) 推荐(0)
HDU 1022 Train Problem I stack 基础题
摘要:题意:有一个火车站,只有一个口同时用于进入和出去,但不能有2辆或以上同时进出。给出一个n代表有n辆火车(n 2 #include 3 #include 4 using namespace std; 5 char in[12]; 6 char out[12]; 7 int ans[24]; 8 int... 阅读全文
posted @ 2015-04-05 12:47 _fukua 阅读(262) 评论(0) 推荐(0)
HDU2102 A计划 BFS 简单题 有坑点 好题
摘要:Problem Description可怜的公主在一次次被魔王掳走一次次被骑士们救回来之后,而今,不幸的她再一次面临生命的考验。魔王已经发出消息说将在T时刻吃掉公主,因为他听信谣言说吃公主的肉也能长生不老。年迈的国王正是心急如焚,告招天下勇士来拯救公主。不过公主早已习以为常,她深信智勇的骑士LJ肯定... 阅读全文
posted @ 2015-04-05 01:12 _fukua 阅读(501) 评论(0) 推荐(0)
HDU 2553 N皇后问题 DFS 简单题
摘要:Problem Description在N*N的方格棋盘放置了N个皇后,使得它们不相互攻击(即任意2个皇后不允许处在同一排,同一列,也不允许处在与棋盘边框成45角的斜线上。你的任务是,对于给定的N,求出有多少种合法的放置方法。Input共有若干行,每行一个正整数N≤10,表示棋盘和皇后的数量;如果N... 阅读全文
posted @ 2015-04-04 15:07 _fukua 阅读(286) 评论(0) 推荐(0)
HDU 1426 Sudoku Killer DFS 简单题
摘要:给出一个数独的一部分,然后然后要我们填完整这个数独。Input本题包含多组测试,每组之间由一个空行隔开。每组测试会给你一个 9*9 的矩阵,同一行相邻的两个元素用一个空格分开。其中1-9代表该位置的已经填好的数,问号(?)表示需要你填的数。Output对于每组测试,请输出它的解,同一行相邻的两个数用... 阅读全文
posted @ 2015-04-04 14:26 _fukua 阅读(271) 评论(0) 推荐(0)
HDU2510 符号三角形 DFS直接打表
摘要:Problem Description符号三角形的 第1行有n个由“+”和”-“组成的符号 ,以后每行符号比上行少1个,2个同号下面是”+“,2个异 号下面是”-“ 。计算有多少个不同的符号三角形,使其所含”+“ 和”-“ 的个数相同 。 n=7时的1个符号三角形如下:+ + - + - + ++ ... 阅读全文
posted @ 2015-04-04 12:09 _fukua 阅读(465) 评论(0) 推荐(0)
HDU1584 蜘蛛牌 DFS 简单题
摘要:题意:蜘蛛牌是windows xp操作系统自带的一款纸牌游戏,游戏规则是这样的:只能将牌拖到比她大一的牌上面(A最小,K最大),如果拖动的牌上有按顺序排好的牌时,那么这些牌也跟着一起移动,游戏的目的是将所有的牌按同一花色从小到大排好,为了简单起见,我们的游戏只有同一花色的10张牌,从A到10,且随机... 阅读全文
posted @ 2015-04-03 19:31 _fukua 阅读(357) 评论(1) 推荐(0)
HDU1016 Prime Ring Problem DFS 简单题
摘要:题意:输入n,代表有一个n个节点的环,然后在节点分别填入1到n这n个数,规定,第一个填入的必须是1.0 2 #include 3 #include 4 #include 5 using namespace std; 6 bool prime[43]; 7 bool vis[25]; 8 int to... 阅读全文
posted @ 2015-04-03 16:38 _fukua 阅读(256) 评论(0) 推荐(0)
HDU 1556 color the ball
摘要:树状数组,插段问点有一行气球,给出n个区间,每次对区间内的每个气球涂一次色,问最后每个气球各涂了多少次。 1 #include 2 #include 3 const int MAXN=100000+5; 4 int c[MAXN]; 5 int n; 6 int lowbit(int x) 7 { ... 阅读全文
posted @ 2015-04-03 13:32 _fukua 阅读(232) 评论(0) 推荐(0)
POJ2182 Lost Cows 树状数组
摘要:一群牛,编号为1到n,但是编号乱了,已知每只牛的前面有多少只编号比其小,求出牛的编号。插点问段。这道题要从后面反推回来,比如最后的一只牛,知道有a只编号比它小,则它的编号为a+1。update 更新已经确定的编号,sum(i) 查询已经确定的编号中(后面的牛的编号都确定了),有多少个比i小。 1 #... 阅读全文
posted @ 2015-04-03 13:27 _fukua 阅读(260) 评论(0) 推荐(0)
POJ3067 Japan 树状数组
摘要:Japan某城市的左边从上到下有n个城市,右边从上到下有m个城市,现要建k条高铁,起点在左边,终点在右边,问有多少个交点(任一交点只能有2条线同时经过)。排序+树状数组,插点问段。排序后,按起点从小到大扫一遍,a[j]表示前i条线中,终点为j的个数。c[j]a[j]的树状数组。注意:最后结果要用lo... 阅读全文
posted @ 2015-04-03 13:17 _fukua 阅读(236) 评论(0) 推荐(0)
poj2352 starts 树状数组
摘要:有n个星星,按照y坐标的升序给出n个星星的坐标,对于每一个星星,其level为在其左下方(包括正左,正下)的星星个数,输出n行,第i行代表等级为i个星星的星星的个数。树状数组的插点问段思路:a[i]存储星星的x坐标,b[i]表示0到i中x,y坐标小于i的个数,即i的等级则对于每个b[i],做一次扫描... 阅读全文
posted @ 2015-04-03 13:13 _fukua 阅读(256) 评论(0) 推荐(0)
Codeforces Round #286 (Div. 2)
摘要:A题:给出一个长度为n的字符串,操作:在这个字符串的任意位置(前后也可以)插入一个字符,使之成为一个回文串,而且,即使这个字符串本身就是回文串,你也必须插入一个字符。若无法达成目的,输出"NA"由于题意n 2 #include 3 char s[11]; 4 int main() 5 { 6 ... 阅读全文
posted @ 2015-04-02 00:58 _fukua 阅读(277) 评论(0) 推荐(0)
Codeforces Round #289 (Div. 2, ACM ICPC Rules)
摘要:A题:有一个n*n的矩阵,矩阵的第一行和第一列的值都为1,其余的有:a[i][j]=a[i-1][j]+a[i][j-1];现在给出一个n求出这个n*n的矩阵中最大的数。显然,最大的数就是a[n][n]。因为n 2 int maze[11][11]; 3 int main() 4 { 5 f... 阅读全文
posted @ 2015-04-01 13:07 _fukua 阅读(206) 评论(0) 推荐(0)