
Vjudge
文章平均质量分 75
努力过
喜欢coding
展开
-
2016中国大学生程序设计竞赛(ccpc 长春) Fraction【模拟】
Problem DescriptionMr. Frog recently studied how to add two fractions up, and he came up with an evil idea to trouble you by asking you to calculate the result of the formula below:As a talent原创 2017-09-12 22:40:07 · 556 阅读 · 0 评论 -
A - Prime Ring Problem uva524素数环【dfs】
题目链接:https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=465题意:输入整数n,把1...n的组成环,使得相邻两个整数之和均为素数。输出排列的方案环。思路:先生成一个素数数组,便于之后进行判断。我用的回溯法,有人说用dp哎原创 2017-09-11 22:57:39 · 233 阅读 · 0 评论 -
B - Radar Installation poj 1328【贪心】
Assume the coasting is an infinite straight line. Land is in one side of coasting, sea in the other. Each small island is a point locating in the sea side. And any radar installation, locating on the原创 2017-09-04 22:28:59 · 317 阅读 · 0 评论 -
【背包专题】K - WHUgirls hdu3127 【二维完全背包】
There are many pretty girls in Wuhan University, and as we know, every girl loves pretty clothes, so do they. One day some of them got a huge rectangular cloth and they want to cut it into small recta原创 2017-08-28 12:29:04 · 240 阅读 · 0 评论 -
【背包专题】J - Piggy-Bank hdu1114【完全背包】
Before ACM can do anything, a budget must be prepared and the necessary financial support obtained. The main income for this action comes from Irreversibly Bound Money (IBM). The idea behind is simple原创 2017-08-28 09:33:20 · 229 阅读 · 0 评论 -
【背包专题】H - 钱币兑换问题 hdu1284【完全背包】
在一个国家仅有1分,2分,3分硬币,将钱N兑换成硬币有很多种兑法。请你编程序计算出共有多少种兑法。Input每行只有一个正整数N,N小于32768。Output对应每个输入,输出兑换方法数。Sample Input293412553Sample Output71883113137761思路:完全背包来解决这道题。先递推出只兑换1分硬币时的兑换方法有多少种,再递推出加原创 2017-08-27 13:03:41 · 349 阅读 · 0 评论 -
【背包专题】C - The trouble of Xiaoqian hdu3591【混合背包:多重背包+完全背包】
In the country of ALPC , Xiaoqian is a very famous mathematician. She is immersed in calculate, and she want to use the minimum number of coins in every shopping. (The numbers of the shopping include原创 2017-08-27 11:11:57 · 247 阅读 · 0 评论 -
codeup5972:全排列 【递归入门】
题目描述 排列与组合是常用的数学方法。 先给一个正整数 ( 1 例如n=3,所有组合,并且按字典序输出: 1 2 3 1 3 2 2 1 3 2 3 1 3 1 2 3 2 1 输入输入一个整数n( 1输出输出所有全排列每个全排列一行,相邻两个数用空格隔开(最后一个数后面没有空格)样例输入原创 2017-08-26 16:56:13 · 518 阅读 · 0 评论 -
【背包专题】G - Dividing hdu 1059【多重背包】
Marsha and Bill own a collection of marbles. They want to split the collection among themselves so that both receive an equal share of the marbles. This would be easy if all the marbles had the same v原创 2017-08-26 15:21:19 · 255 阅读 · 0 评论 -
【背包专题】I - 湫湫系列故事——减肥记I hdu4508【完全背包】
对于吃货来说,过年最幸福的事就是吃了,没有之一! 但是对于女生来说,卡路里(热量)是天敌啊! 资深美女湫湫深谙“胖来如山倒,胖去如抽丝”的道理,所以她希望你能帮忙制定一个食谱,能使她吃得开心的同时,不会制造太多的天敌。 当然,为了方便你制作食谱,湫湫给了你每日食物清单,上面描述了当天她想吃的每种食物能带给她的幸福程度,以及会增加的卡路里量。Input 输入包含原创 2017-08-26 14:30:13 · 236 阅读 · 0 评论 -
【背包专题】F - Ahui Writes Word hdu3732【01背包+二进制优化】
We all know that English is very important, so Ahui strive for this in order to learn more English words. To know that word has its value and complexity of writing (the length of each word does not ex原创 2017-08-26 11:49:32 · 213 阅读 · 0 评论 -
【背包专题】 D - Coins hdu2844【多重背包】
Whuacmers use coins.They have coins of value A1,A2,A3...An Silverland dollar. One day Hibix opened purse and found there were some coins. He decided to buy a very nice watch in a nearby shop. He wante原创 2017-08-25 20:59:47 · 360 阅读 · 0 评论 -
【背包专题】D - Coins hdu 2844 【01背包+二进制优化】
Whuacmers use coins.They have coins of value A1,A2,A3...An Silverland dollar. One day Hibix opened purse and found there were some coins. He decided to buy a very nice watch in a nearby shop. He wante原创 2017-08-25 16:57:05 · 421 阅读 · 0 评论 -
【背包专题】B - FATE hdu2159【二维完全背包】
最近xhd正在玩一款叫做FATE的游戏,为了得到极品装备,xhd在不停的杀怪做任务。久而久之xhd开始对杀怪产生的厌恶感,但又不得不通过杀怪来升完这最后一级。现在的问题是,xhd升掉最后一级还需n的经验值,xhd还留有m的忍耐度,每杀一个怪xhd会得到相应的经验,并减掉相应的忍耐度。当忍耐度降到0或者0以下时,xhd就不会玩这游戏。xhd还说了他最多只杀s只怪。请问他能升掉这最后一级吗?I原创 2017-08-25 09:11:29 · 184 阅读 · 0 评论 -
【背包专题】A - Bone Collector II hdu2639 【01背包的第k个最优解】
The title of this problem is familiar,isn't it?yeah,if you had took part in the "Rookie Cup" competition,you must have seem this title.If you haven't seen it before,it doesn't matter,I will give you a原创 2017-08-24 11:37:56 · 240 阅读 · 0 评论 -
【背包专题】E - 悼念512汶川大地震遇难同胞——珍惜现在,感恩生活 hdu2191【多重背包】
急!灾区的食物依然短缺! 为了挽救灾区同胞的生命,心系灾区同胞的你准备自己采购一些粮食支援灾区,现在假设你一共有资金n元,而市场有m种大米,每种大米都是袋装产品,其价格不等,并且只能整袋购买。 请问:你用有限的资金最多能采购多少公斤粮食呢? 后记: 人生是一个充满了变数的生命过程,天灾、人祸、病痛是我们生命历程中不可预知的威胁。 月有阴晴圆缺,人有旦夕祸福,未来对于我们而言原创 2017-08-23 20:25:58 · 218 阅读 · 0 评论 -
【比赛练习ac题】poj2253+hdu2717+poj2387+poj1258【解题报告】
A - Catch That Cow Farmer John has been informed of the location of a fugitive cow and wants to catch her immediately. He starts at a point N (0 ≤ N ≤ 100,000) on a number line and the cow is at原创 2017-08-17 15:14:54 · 360 阅读 · 0 评论 -
【并查集入门专题1】E - The Suspects poj1611【并查集模板】
Severe acute respiratory syndrome (SARS), an atypical pneumonia of unknown aetiology, was recognized as a global threat in mid-March 2003. To minimize transmission to others, the best strategy is to s原创 2017-08-16 14:44:45 · 273 阅读 · 0 评论 -
【并查集入门专题1】A+B+D 三道模板题 hdu1232 hdu1233 poj2524【并查集模板】
~~~~连续三道水题,也只能用提高手速这样理由来安慰自己了,不过,从d题数组超限自己改为边存边合并的方法看来还是有收获吧,只能这样强行“收获了”(泪目)某省调查城镇交通状况,得到现有城镇道路统计表,表中列出了每条道路直接连通的城镇。省政府“畅通工程”的目标是使全省任何两个城镇间都可以实现交通(但不一定有直接的道路相连,只要互相间接通过道路可达即可)。问最少还需要建设多少条道路?原创 2017-08-15 22:02:45 · 295 阅读 · 0 评论 -
【并查集入门专题1】F - How Many Tables hdu1213【并查集水题】
Today 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 other, a原创 2017-08-15 21:00:17 · 266 阅读 · 0 评论 -
【二分匹配入门专题1】P - Ants poj2565【km----卡精度】
Young naturalist Bill studies ants in school. His ants feed on plant-louses that live on apple trees. Each ant colony needs its own apple tree to feed itself.Bill has a map with coordinates of n ant原创 2017-08-15 08:26:01 · 378 阅读 · 0 评论 -
【二分图匹配入门专题1】O - Assignment hdu2853【km巧妙变形】
Last year a terrible earthquake attacked Sichuan province. About 300,000 PLA soldiers attended the rescue, also ALPCs. Our mission is to solve difficulty problems to optimization the assignment of tro原创 2017-08-14 22:55:11 · 346 阅读 · 1 评论 -
【二分图匹配入门专题1】 N - Special Fish hdu3395 【km算法】【春风十里,都不如tle~~~】
There is a kind of special fish in the East Lake where is closed to campus of Wuhan University. It’s hard to say which gender of those fish are, because every fish believes itself as a male, and it ma原创 2017-08-14 17:51:02 · 718 阅读 · 0 评论 -
【二分图匹配入门专题1】M - Cyclic Tour hdu1853【km算法--判断自重边】
There are N cities in our country, and M one-way roads connecting them. Now Little Tom wants to make several cyclic tours, which satisfy that, each cycle contain at least two cities, and each city bel原创 2017-08-14 15:37:15 · 310 阅读 · 0 评论 -
【二分图匹配入门专题1】L - Card Game hdu 3722【km算法】
Jimmy invents an interesting card game. There are N cards, each of which contains a string Si. Jimmy wants to stick them into several circles, and each card belongs to one circle exactly. When stickin原创 2017-08-14 12:38:37 · 269 阅读 · 0 评论 -
【二分图匹配入门专题1】K - Going Home hdu1533【km算法--最小匹配】
On a grid map there are n little men and n houses. In each unit time, every little man can move one unit step, either horizontally, or vertically, to an adjacent point. For each little man, you need t原创 2017-08-14 07:59:31 · 440 阅读 · 0 评论 -
【二分匹配入门专题1】J - 奔小康赚大钱 hdu2255【KM算法】
传说在遥远的地方有一个非常富裕的村落,有一天,村长决定进行制度改革:重新分配房子。 这可是一件大事,关系到人民的住房问题啊。村里共有n间房间,刚好有n家老百姓,考虑到每家都要有房住(如果有老百姓没房子住的话,容易引起不安定因素),每家必须分配到一间房子且只能得到一间房子。 另一方面,村长和另外的村领导希望得到最大的效益,这样村里的机构才会有钱.由于老百姓都比较富裕,他们都能对每一间房子在他原创 2017-08-13 18:33:27 · 285 阅读 · 0 评论 -
【二分图匹配入门专题1】I - Hiding Gold light oj 1152【二分图匹配】-----我是终于不那么水的水题分割线-------------------------
You are given a 2D board where in some cells there are gold. You want to fill the board with 2 x 1 dominoes such that all gold are covered. You may use the dominoes vertically or horizontally and the原创 2017-08-13 13:50:08 · 316 阅读 · 2 评论 -
【二分图匹配入门专题1】H - Marriage Media light oj 1184【二分图最大匹配】
You run a marriage media. You take some profiles for men and women, and your task is to arrange as much marriages as you can. But after reading their bio-data you have found the following criteria.原创 2017-08-13 13:29:58 · 316 阅读 · 0 评论 -
【二分匹配入门专题1】G - Asteroids poj3041【最小顶点覆盖】
Bessie wants to navigate her spaceship through a dangerous asteroid field in the shape of an N x N grid (1 Fortunately, Bessie has a powerful weapon that can vaporize all the asteroids in any give原创 2017-08-13 13:20:45 · 265 阅读 · 0 评论 -
【二分图匹配入门专题1】E - Air Raid hdu1151【最小路径覆盖】
Consider a town where all the streets are one-way and each street leads from one intersection to another. It is also known that starting from an intersection and walking through town's streets you can原创 2017-08-13 07:57:59 · 227 阅读 · 0 评论 -
【二分图匹配入门专题1】F - COURSES poj1469【最大匹配--匈牙利算法模板题】
Consider a group of N students and P courses. Each student visits zero, one or more than one courses. Your task is to determine whether it is possible to form a committee of exactly P students that sa原创 2017-08-13 06:40:35 · 349 阅读 · 0 评论 -
【二分图匹配入门专题1】D - Matrix hdu2119【最小顶点覆盖】
Give you a matrix(only contains 0 or 1),every time you can select a row or a column and delete all the '1' in this row or this column . Your task is to give out the minimum times of deleting all t原创 2017-08-13 06:30:21 · 493 阅读 · 0 评论 -
【二分图匹配入门专题1】B - Girls and Boys hdu1068【最大独立集】
the second year of the university somebody started a study on the romantic relations between the students. The relation “romantically involved” is defined between one girl and one boy. For the study原创 2017-08-12 15:43:03 · 551 阅读 · 0 评论 -
【二分图匹配入门专题1】A - 过山车 hdu2063 【匈牙利算法的模板题】
过山车Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 23353 Accepted Submission(s): 10128Problem DescriptionRPG girls今天和大家一起去游原创 2017-08-12 11:22:35 · 310 阅读 · 0 评论 -
【字符串入门专题1】C - A + B for you again hdu1867【kmp】
Problem DescriptionGenerally speaking, there are a lot of problems about strings processing. Now you encounter another such problem. If you get two strings, such as “asdf” and “sdfg”, the result o原创 2017-08-10 09:19:37 · 208 阅读 · 0 评论 -
【字符串入门专题1】D - Period hdu 1358【kmp-最小循环节简单应用】
PeriodProblem DescriptionFor each prefix of a given string S with N characters (each character has an ASCII code between 97 and 126, inclusive), we want to know whether the prefix is a p原创 2017-08-09 18:03:13 · 324 阅读 · 0 评论 -
【字符串入门专题1】F - Seek the Name, Seek the Fame poj2752【kmp】
Seek the Name, Seek the FameDescriptionThe little cat is so famous, that many couples tramp over hill and dale to Byteland, and asked the little cat to give names to their newly-born babies.原创 2017-08-09 17:19:10 · 263 阅读 · 0 评论 -
【字符串入门专题1】B - Simpsons’ Hidden Talents hdu2594【kmp】
Simpsons’ Hidden TalentsTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 9765 Accepted Submission(s): 3378Problem DescriptionH原创 2017-08-09 10:50:19 · 365 阅读 · 0 评论 -
【字符串入门专题1】J - Oulipo hdu1686 【kmp】
Problem DescriptionThe French author Georges Perec (1936–1982) once wrote a book, La disparition, without the letter 'e'. He was a member of the Oulipo group. A quote from the book:Tout avait原创 2017-08-08 23:29:54 · 455 阅读 · 0 评论