码迷,mamicode.com
首页 >  
搜索关键字:hdu 1247 hats words    ( 33109个结果
hdu 4460
break point 在 边数很少,o(n*m)暴力出奇迹~~~#include#include#include#include#include#include#includeusing namespace std;const int maxn = 1005, maxm = 22222, inf=...
分类:其他好文   时间:2014-06-09 23:00:47    阅读次数:342
hdu 2177(威佐夫博奕)
题意:容易理解,在威佐夫博奕的基础上新增加了一条要求:就是如果在赢得条件下,输出第一步怎么走。分析:使用暴力判断,详细见代码。代码:#include#include#includeint a, b;int main(){ double x = (1 + sqrt(5.0))/2.0; i...
分类:其他好文   时间:2014-06-09 22:54:44    阅读次数:231
HDU 1495 非常可乐 (BFS)
问题链接:http://acm.hdu.edu.cn/showproblem.php?pid=1495 题目大意:一个瓶子容积s,两个杯子容积分别n,m,并且都没有刻度(不能比对噢!)。相互倒水,求平分的他们的最少倒水次数。 思路:暴力搜索吧。并且求最少,(即最优解),随意上BFS; 思考:状态,转移过程,怎么剪纸。 惨痛的debug,我不解释了。...
分类:其他好文   时间:2014-06-08 15:48:26    阅读次数:234
HDU 1754 I hate it 分段树Segment Tree题解
给出一段数据,然后要更新单个数据,会询问一段数据中的最大值。 又是一道分段树操作。渐渐熟手了。 #pragma once #include #include using namespace std; class IHateIt_1754_1 { static const int SIZE = 200001; int *segTree; //不要使用segTree[SIZE<<2]...
分类:其他好文   时间:2014-06-08 15:40:21    阅读次数:208
Leetcode: Text Justification. java
Given an array of words and a length L, format the text such that each line has exactly L characters and is fully (left and right) justified. You should pack your words in a greedy approach; that i...
分类:编程语言   时间:2014-06-08 15:25:00    阅读次数:282
leetcode——Reverse Words in a String 旋转字符串中单词顺序(AC)
题目如下: Given an input string, reverse the string word by word. For example, Given s = "the sky is blue", return "blue is sky the". click to show clarification. Clarification: What co...
分类:其他好文   时间:2014-06-08 14:58:13    阅读次数:231
HDU 1075 What Are You Talking About
Problem Description Ignatius is so lucky that he met a Martian yesterday. But he didn't know the language the Martians use. The Martian gives him a history book of Mars and a dictionary when it leave...
分类:其他好文   时间:2014-06-08 03:55:37    阅读次数:273
HDU 1102 Constructing Roads (裸的并查集)
题目意思:有n个村庄,编号1-n,以矩阵的形式给出任意两个村庄之间的距离,然后告诉已经有q个村庄已经修好了路,问现在要打算使所有村庄都联通需要修路的最小长度。 思路就是构造一棵最小生成树,所以将距离排序,从小到大依次并入,直到集合数为1为止。...
分类:其他好文   时间:2014-06-08 03:22:29    阅读次数:289
HDU 2072 单词数
Problem Description lily的好朋友xiaoou333最近很空,他想了一件没有什么意义的事情,就是统计一篇文章里不同单词的总数。下面你的任务是帮助xiaoou333解决这个问题。   Input 有多组数据,每组一行,每组就是一篇小文章。每篇小文章都是由小写字母和空格组成,没有标点符号,遇到#时表示输入结束。   Output ...
分类:其他好文   时间:2014-06-08 03:08:15    阅读次数:221
HDU 1247 Hat’s Words
Problem Description A hat’s word is a word in the dictionary that is the concatenation of exactly two other words in the dictionary. You are to find all the hat’s words in a dictionary.   In...
分类:其他好文   时间:2014-06-08 03:02:14    阅读次数:323
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!