摘要: 总算水完第350题了。之间过了个元旦,然后打了几天游戏,然后原来的博客被封了,移数据、开新博客又搞了两天。搞得老衲现在没神马手感了,悲了个剧! 阅读全文
posted @ 2012-01-08 05:27 Seraph2012 阅读(97) 评论(0) 推荐(0) 编辑
摘要: 地址:http://acm.hdu.edu.cn/showproblem.php?pid=1563题意:找n个数里只出现了1次的数。mark:hash搞之。大于200的最小素数是211。代码:# include <stdio.h># include <string.h>int dp[211][2] ;void insert (int n){ int idx = n % 211 ; while (dp[idx][0] != n && dp[idx][1] != 0) idx++ ; dp[idx][0] = n ; dp[idx][1] ++ ;}int 阅读全文
posted @ 2012-01-08 05:25 Seraph2012 阅读(144) 评论(0) 推荐(0) 编辑
摘要: 地址:http://acm.hdu.edu.cn/showproblem.php?pid=1491题意:给一个2006年的日期,问和2006年10月21日还差几天。mark:getdays是用于获得m月d日是当年的第几天。最后和10月21日做比较。代码:# include <stdio.h>int getdays (int m, int d){ int i, rtn = 0, month [12] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30} ; for (i = 0 ; i < m ; i++) rtn += m... 阅读全文
posted @ 2012-01-08 05:11 Seraph2012 阅读(209) 评论(0) 推荐(0) 编辑
摘要: 地址:http://acm.hdu.edu.cn/showproblem.php?pid=1253题意:中文。。。mark:三维BFS水过。其实和二维没多大区别。代码:# include <stdio.h># include <string.h># define REP(i,a) for(i = 0 ; i < a ; i++)int q[55*55*55][3] ;int graph[55][55][55] ;int step[55][55][55] ;int a, b, c, t ;int tab[6][3] = {{0, 0, 1}, {0, 0, -1}, 阅读全文
posted @ 2012-01-08 01:09 Seraph2012 阅读(221) 评论(0) 推荐(0) 编辑
摘要: 地址:http://acm.hdu.edu.cn/showproblem.php?pid=1577题意:中文。mark:gcd是否为1。注意不能有除数为0。代码:# include <stdio.h>int abs(int n){return n<0?-n:n;}int gcd(int a, int b){return a%b==0?b:gcd(b,a%b);}int main (){ int l, px, py, sx, sy ; while (~scanf ("%d", &l), l) { scanf ("%d%d%d%d" 阅读全文
posted @ 2012-01-08 00:11 Seraph2012 阅读(190) 评论(0) 推荐(0) 编辑