水
文章平均质量分 65
czjxy881
这个作者很懒,什么都没留下…
展开
-
poj 2243 Knight Moves bfs
水题,裸的bfs,基本没有要注意的/*author:jxylang:C/C++university:China,Xidian University**If you need to reprint,please indicate the source***/#include #include #include #include #include #define INF 1E原创 2012-11-27 21:21:26 · 520 阅读 · 0 评论 -
poj 1751 Highways MST
水到家的一道题,居然WA了3次……没注意到距离是double……没有输出的话要输出一行空行 /*author:jxylang:C/C++university:China,Xidian University**If you need to reprint,please indicate the source***/#include #include #include #原创 2013-01-31 21:46:57 · 412 阅读 · 0 评论 -
poj 1789 Truck History MST
prim/*author:jxylang:C/C++university:China,Xidian University**If you need to reprint,please indicate the source***/#include #include #include #include #include #define INF 1E9using names原创 2013-01-31 20:35:47 · 366 阅读 · 0 评论 -
poj 2421 Constructing Roads MST
一开始看错题了,是有已建好的路,看成必须要建的路了,prim很水/*author:jxylang:C/C++university:China,Xidian University**If you need to reprint,please indicate the source***/#include #include #include #include #in原创 2013-01-30 11:30:31 · 325 阅读 · 0 评论 -
uva 10591 - Happy Number hash
非常简单的题,易知平方和后不超过800,开个800的数组,预处理,然后直接定址就可以了,不过要注意a和an的区别/*author:jxylang:C/C++university:China,Xidian University**If you need to reprint,please indicate the source***/#include #include #incl原创 2013-01-31 17:33:17 · 480 阅读 · 0 评论 -
poj 3206 Borg Maze MST
很无聊的题目,先bfs求下最短,再prim,输入还有多余空格……懒得敲了,随便找了个代码。以下代码从http://hi.baidu.com/00gfzs/item/6dd7bf221b955c404799624a转载#include #include #include #include using namespace std;int Val[102];//prim记录最优值b原创 2013-01-31 22:59:15 · 471 阅读 · 0 评论 -
zoj 2750 Idiomatic Phrases Game 最短路
一个预处理比较累的最短路,要先生成边,编码是16进制,一开始写成10进制一直WA……/*author:jxylang:C/C++university:China,Xidian University**If you need to reprint,please indicate the source***/#include #include #include #incl原创 2013-02-02 21:55:37 · 381 阅读 · 0 评论 -
uva 11218 - KTV 简单回溯
感觉有比回溯更加高效的方法,但是水平不够,只会回溯/*author:jxylang:C/C++university:China,Xidian University**If you need to reprint,please indicate the source***/#include #include #include #include #include #d原创 2013-02-01 16:52:37 · 522 阅读 · 0 评论 -
uva 11210 - Chinese Mahjong 暴力回溯
最近很颓废,一直不想写题,今天说写题结果一直拖到现在才写了一题…… 一个很简单的模拟题,只要会打麻将就会写,注意牌不能超过4张的,编号的转换有点累/*author:jxylang:C/C++university:China,Xidian University**If you need to reprint,please indicate the source***原创 2013-02-12 00:03:30 · 704 阅读 · 0 评论 -
poj 1556 The Doors 最短路
很水的一题,但是改了好久都没改对。 原因是被定式思维害了,以为判断直线与点的位置只要返回个符号所以用int,但没想到负的double很小的时候变成int会成0,即丢失了原有符号。一直看了好几个小时才看出来。还是不够细致,这几天有点分心了。/*author:jxylang:C/C++university:China,Xidian University**If you原创 2013-02-16 00:57:04 · 376 阅读 · 0 评论 -
poj 1828 Monkeys' Pride 模拟
排个序,模拟下就好了,水题一个/*author:jxylang:C/C++university:China,Xidian University**If you need to reprint,please indicate the source***/#include #include #include #include #include #define INF原创 2013-05-07 09:38:17 · 567 阅读 · 0 评论 -
uva 10763 - Foreign Exchange 水
要求严格a-b,b-a,所以分别对a,b排个序,然后比较是不是严格相同/*author:jxylang:C/C++university:China,Xidian University**If you need to reprint,please indicate the source***/#include #include #include #include #inclu原创 2013-07-24 16:40:48 · 588 阅读 · 0 评论 -
hdu 4707 Pet 水
热身赛就写这一题还读错题意了,以为是求长度为d的最小覆盖集,结果居然是求深度大于d的点数……/*author:jxylang:C/C++university:China,Xidian University**If you need to reprint,please indicate the source***/#include #include #include #incl原创 2013-09-09 11:30:44 · 669 阅读 · 0 评论 -
uva 1398 - Meteor 模拟 99
最近多练练简单题,简单的扫描线/*author:jxylang:C/C++university:China,Xidian University**If you need to reprint,please indicate the source***/#include #include #include #include #include using namespac原创 2013-09-30 13:17:24 · 554 阅读 · 0 评论 -
11384 - Help is needed for Dexter 模拟 98
分治法/*author:jxylang:C/C++university:China,Xidian University**If you need to reprint,please indicate the source***/#include #include #include #include #include using namespace std;int o原创 2013-10-01 00:50:42 · 514 阅读 · 0 评论 -
poj 1258 Agri-Net MST
和2421基本上一模一样……/*author:jxylang:C/C++university:China,Xidian University**If you need to reprint,please indicate the source***/#include #include #include #include #include #define INF 1E9原创 2013-01-31 21:55:58 · 375 阅读 · 0 评论 -
uva 141 The Spot Game hash
很简单的hash,可以知道只需要保存每行每列的总个数即可唯一确定图,所以只需开两个50的数组即可,然后对最长为100的字符串进行hash,一开始想直接ELF,但后来发现还是有重复,懒得写拉链法了,直接用map,0.008s就过了/*author:jxylang:C/C++university:China,Xidian University**If you need to rep原创 2013-01-31 16:25:11 · 820 阅读 · 0 评论 -
poj 2031 Building a Space Station MST
这种n^2的,还是prim好用/*author:jxylang:C/C++university:China,Xidian University**If you need to reprint,please indicate the source***/#include #include #include #include #include #define INF 1E9原创 2013-01-30 10:58:02 · 276 阅读 · 0 评论 -
poj 2935 Basic Wall Maze bfs
很简单的bfs,各点都从0开始保存,可以用%和/确定x,y省空间 /*author:jxylang:C/C++university:China,Xidian University**If you need to reprint,please indicate the source***/#include #include #include #define place(x,原创 2012-11-28 15:42:11 · 432 阅读 · 0 评论 -
hdu 1062 Text Reverse
直接读取字符串,然后倒序输出要注意的就是中间的空白字符必须全部输出,不然会PE。 /*author:jxylang:C/C++university:China,Xidian University**If you need to reprint,please indicate the source***/#include #include char s[1001],t;原创 2012-11-28 19:56:52 · 338 阅读 · 0 评论 -
poj 1200 Crazy Search
给字母编码后,用NC当进制进行hash,或者直接java水过 /*author:jxylang:C/C++university:China,Xidian University**If you need to reprint,please indicate the source***/#include #include #include #include #include原创 2012-12-02 13:12:06 · 473 阅读 · 0 评论 -
hdu 1056 HangOver 水题
HangOver 很水的一道题,无论是时间空间都约等于没有要求,直接模拟就可以过了。/*author:jxylang:C/C++university:China,Xidian University**If you need to reprint,please indicate the source***/#include int main(){原创 2012-11-20 11:05:01 · 411 阅读 · 0 评论 -
hdu 1057 A New Growth Industry
1057 A New Growth Industry 简单模拟题,貌似uva上也有 注意数据间要有空行/*author:jxylang:C/C++university:China,Xidian University**If you need to reprint,please indicate the source***/#include #in原创 2012-11-21 17:15:03 · 1044 阅读 · 0 评论 -
cf 151.div2 C - Beauty Pageant
C - Beauty Pageant 很简单的一道题,就是给出k种不同的组合就可以了,比赛的时候没有注意到k的范围,直接dfs,果断超时,k只有(n+1)n/2种,所以可以直接枚举即可…… 以后要看好范围再写 dfs代码(修改后)/*author:jxylang:C/C++university:China,Xidian University原创 2012-11-22 11:30:20 · 631 阅读 · 0 评论 -
hdu 1061 Rightmost Digit
和上一题一样的,只是最右边的数。找规律,20个一循环 import java.util.Scanner;public class Main{ final static int a[]={0,1,4,7,6,5,6,3,6,9,0,1,6,3,6,5,6,7,4,9}; static Scanner cin=new Scanner(System.in); static int n原创 2012-11-24 14:17:43 · 378 阅读 · 0 评论 -
cf 153.div2 B. Unsorting Array
B. Unsorting Array 最近写题目越来越少了,以至于这种简单题都会错……比赛的时候写了个n^2的算法,果断超时,赛后加了个剪枝,78ms 但是其实因为只要把有序序列中的连续不相等的两项交换,即可使之无序……所以o(n)就够了 o(n^2)/*author:jxylang:C/C++university:China,Xidian原创 2012-12-09 01:15:46 · 721 阅读 · 0 评论 -
hdu 1064 Financial Management
求12个数的平均值……充数的……原创 2012-12-11 01:08:23 · 373 阅读 · 0 评论 -
uva 188 - Perfect Hash 模拟
这题只要读懂题就等于没难度了,完全照着题目给的公式模拟即可 要注意的就是末尾的多余空格。 /*author:jxylang:C/C++university:China,Xidian University**If you need to reprint,please indicate the source***/#include #include #include原创 2012-12-11 18:12:27 · 624 阅读 · 0 评论 -
uva 10282 - Babelfish
这题可以用map直接水过,但是那样就没有什么意思了。 所以还是用hash表写了下,学习了一下hash链表的方法,其实就是做一个邻接表,但是这样在判断时还要比较生成hash值的string,而且如果hash函数没构造好,复杂度会大大增加,不过是一个解决冲突的好办法。 /*author:jxylang:C/C++university:China,Xidian Unive原创 2012-12-14 22:02:50 · 579 阅读 · 0 评论 -
hdu 1071 The area
纯数学积分,好久没写数学题了,大一学的高数都忘得差不多了…… /*author:jxylang:C/C++university:China,Xidian University**If you need to reprint,please indicate the source***/#include #include #include #include #include原创 2012-12-16 00:46:20 · 481 阅读 · 0 评论 -
hdu 1073 Online Judge
非常简单的字符串匹配,懒得又读取又切割,于是就用了一个懒一点的方法直接比较了/*author:jxylang:C/C++university:China,Xidian University**If you need to reprint,please indicate the source***/#include #include #include #include原创 2013-01-28 12:10:27 · 338 阅读 · 0 评论 -
poj 1251 Jungle Roads MST
水/*author:jxylang:C/C++university:China,Xidian University**If you need to reprint,please indicate the source***/#include #include #include #include #include #define INF 1E9using namespac原创 2013-01-30 10:30:10 · 305 阅读 · 0 评论 -
zoj 1203 Swordfish MST
很简单的MST,用prim写的,把初始化和维护写在了一起。/*author:jxylang:C/C++university:China,Xidian University**If you need to reprint,please indicate the source***/#include #include #include #include #include #d原创 2013-01-30 08:48:02 · 360 阅读 · 0 评论 -
poj 2975 Nim 水
写这篇题解的目的是提醒一下^的优先级小于/*author:jxylang:C/C++university:China,Xidian University**If you need to reprint,please indicate the source***/#include #include #include #include #include using nam原创 2013-09-22 09:54:15 · 656 阅读 · 0 评论