
VJ
Hu'ang'HX
这个作者很懒,什么都没留下…
展开
-
VJ第一题题解
CodeForces - 118A原题:Petya started to attend programming lessons. On the first lesson his task was to write a simple program. The program was supposed to do the following: in the given string, consist...原创 2018-12-07 19:26:12 · 322 阅读 · 0 评论 -
寒假训练(并查集)
HDU1213Today is Ignatius’ birthday. He invites a lot of friends. Now it’s dinner time. Ignatius wants to know how many tables he needs at least. You have to notice that not all the friends know each ...原创 2019-01-29 18:46:59 · 167 阅读 · 0 评论 -
寒假训练(最短路)
POJ2387Bessie 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 milking. Bessie needs her beauty sleep, so she wants ...原创 2019-01-29 19:03:25 · 106 阅读 · 0 评论 -
寒假训练(最小生成树)
POJ1287You are assigned to design network connections between certain points in a wide area. You are given a set of points in the area, and a set of possible routes for the cables that may connect pa...原创 2019-01-29 19:18:00 · 209 阅读 · 0 评论 -
寒假训练(dfs)
HDU1241The GeoSurvComp geologic survey company is responsible for detecting underground oil deposits. GeoSurvComp works with one large rectangular region of land at a time, and creates a grid that di...原创 2019-01-29 20:09:05 · 196 阅读 · 0 评论 -
寒假训练(卡特兰数)
HDU2067小兔的叔叔从外面旅游回来给她带来了一个礼物,小兔高兴地跑回自己的房间,拆开一看是一个棋盘,小兔有所失望。不过没过几天发现了棋盘的好玩之处。从起点(0,0)走到终点(n,n)的最短路径数是C(2n,n),现在小兔又想如果不穿越对角线(但可接触对角线上的格点),这样的路径数有多少?小兔想了很长时间都没想出来,现在想请你帮助小兔解决这个问题,对于你来说应该不难吧!Input每次输入一...原创 2019-01-29 21:21:29 · 125 阅读 · 0 评论 -
HDU2068(错排公式)
今年暑假杭电ACM集训队第一次组成女生队,其中有一队叫RPG,但做为集训队成员之一的野骆驼竟然不知道RPG三个人具体是谁谁。RPG给他机会让他猜猜,第一次猜:R是公主,P是草儿,G是月野兔;第二次猜:R是草儿,P是月野兔,G是公主;第三次猜:R是草儿,P是公主,G是月野兔;…可怜的野骆驼第六次终于把RPG分清楚了。由于RPG的带动,做ACM的女生越来越多,我们的野骆驼想都知道她们,可现在有N多人,...原创 2019-02-10 19:37:38 · 177 阅读 · 0 评论 -
HDU1575(扩展欧几里得)
要求(A/B)%9973,但由于A很大,我们只给出n(n=A%9973)(我们给定的A必能被B整除,且gcd(B,9973) = 1)。Input数据的第一行是一个T,表示有T组数据。每组数据有两个数n(0 <= n < 9973)和B(1 <= B <= 10^9)。Output对应每组数据输出(A/B)%9973。Sample Input21000 53...原创 2019-02-10 20:59:51 · 200 阅读 · 0 评论 -
HDU1232(并查集)
畅通工程某省调查城镇交通状况,得到现有城镇道路统计表,表中列出了每条道路直接连通的城镇。省政府“畅通工程”的目标是使全省任何两个城镇间都可以实现交通(但不一定有直接的道路相连,只要互相间接通过道路可达即可)。问最少还需要建设多少条道路?Input测试输入包含若干测试用例。每个测试用例的第1行给出两个正整数,分别是城镇数目N ( < 1000 )和道路数目M;随后的M行对应M条道路,每行...原创 2019-02-11 18:31:13 · 165 阅读 · 0 评论 -
寒假训练(01背包)
HDU1171Nowadays, we all know that Computer College is the biggest department in HDU. But, maybe you don’t know that Computer College had ever been split into Computer College and Software College in ...原创 2019-01-29 17:51:13 · 167 阅读 · 0 评论 -
寒假训练(动态规划)
**HDU1069(DP动态规划)**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, and at the mean time, provide the monkey with so...原创 2019-01-29 17:40:07 · 282 阅读 · 0 评论 -
POJ1321(DFS)
在一个给定形状的棋盘(形状可能是不规则的)上面摆放棋子,棋子没有区别。要求摆放时任意的两个棋子不能放在棋盘中的同一行或者同一列,请编程求解对于给定形状和大小的棋盘,摆放k个棋子的所有可行的摆放方案C。Input输入含有多组测试数据。每组数据的第一行是两个正整数,n k,用一个空格隔开,表示了将在一个n*n的矩阵内描述棋盘,以及摆放棋子的数目。 n <= 8 , k <= n当为...原创 2019-02-01 16:33:29 · 132 阅读 · 0 评论 -
VJ第二题题解
CodeForces - 467AGeorge has recently entered the BSUCP (Berland State University for Cool Programmers). George has a friend Alex who has also entered the university. Now they are moving into a dormit...原创 2018-12-07 19:45:15 · 212 阅读 · 0 评论 -
VJ第三题题解
CodeForces - 266AThere are n stones on the table in a row, each of them can be red, green or blue. Count the minimum number of stones to take from the table so that any two neighboring stones had dif...原创 2018-12-07 19:53:27 · 204 阅读 · 0 评论 -
VJ第四题题解
HDU - 1000Calculate A + B.InputEach line will contain two integers A and B. Process to end of file.OutputFor each case, output A + B in one line.Sample Input1 1Sample Output2问题简述:输入不只一组a,b。计...原创 2018-12-07 20:12:11 · 163 阅读 · 0 评论 -
VJ第五题题解
HDU - 1106输入一行数字,如果我们把这行数字中的‘5’都看成空格,那么就得到一行用空格分割的若干非负整数(可能有些整数以‘0’开头,这些头部的‘0’应该被忽略掉,除非这个整数就是由若干个‘0’组成的,这时这个整数就是0)。你的任务是:对这些分割得到的整数,依从小到大的顺序排序输出。Input输入包含多组测试用例,每组输入数据只有一行数字(数字之间没有空格),这行数字的长度不大于10...原创 2018-12-07 20:23:21 · 256 阅读 · 0 评论 -
VJ第六题题解
HDU - 2000输入三个字符后,按各字符的ASCII码从小到大的顺序输出这三个字符。Input输入数据有多组,每组占一行,有三个字符组成,之间无空格。Output对于每组输入数据,输出一行,字符中间用一个空格分开。Sample InputqweasdzxcSample Outpute q wa d sc x z问题分析:用ASCII码比较,将连续的字符串分成几个字符...原创 2018-12-07 20:28:52 · 177 阅读 · 0 评论 -
VJ第七题题解
HDU - 2002根据输入的半径值,计算球的体积。Input输入数据有多组,每组占一行,每行包括一个实数,表示球的半径。Output输出对应的球的体积,对于每组输入数据,输出一行,计算结果保留三位小数。Sample Input11.5Sample Output4.18914.137Hint#define PI 3.1415927问题简述:输入半径,输出球体积,保留三位...原创 2018-12-07 20:33:49 · 207 阅读 · 0 评论 -
VJ第八题题解
HDU - 2101This problem is also a A + B problem,but it has a little difference,you should determine does (a+b) could be divided with 86.For example ,if (A+B)=98,you should output no for result.Input...原创 2018-12-07 20:36:52 · 143 阅读 · 0 评论 -
HDU2546(01背包)
饭卡电子科大本部食堂的饭卡有一种很诡异的设计,即在购买之前判断余额。如果购买一个商品之前,卡上的剩余金额大于或等于5元,就一定可以购买成功(即使购买后卡上余额为负),否则无法购买(即使金额足够)。所以大家都希望尽量使卡上的余额最少。某天,食堂中有n种菜出售,每种菜可购买一次。已知每种菜的价格以及卡上的余额,问最少可使卡上的余额为多少。Input多组数据。对于每组数据:第一行为正整数n,表...原创 2019-01-31 13:38:54 · 119 阅读 · 0 评论 -
hdu1061(快速幂求模)
Given a positive integer N, you should output the most right digit of N^N.InputThe input contains several test cases. The first line of the input is a single integer T which is the number of test ca...原创 2019-02-11 19:12:15 · 293 阅读 · 2 评论