2012年7月20日

摘要: 对于UVA已经无力吐槽了,多打了一个回车就被WA了很久。。。什么鬼玩意。。。给个PE会死嘛?!!!!!!View Code //Result:248 Cutting Corners Accepted C++ 0.468 2012-07-20 07:07:55/* * 1.构建矩形,因为给出了三个点,所以矩形是完全确定的。 * 我们就要找到三个点当中的最中间的那个点。从而构建出一个有序的边序列(顺时针、逆时针均可),用来表示我们的建筑物。 * 又因为建筑是不可横穿的,所以我们加上对角线,每个建筑存六条边。 * 这样就不存在一条横穿建筑但是... 阅读全文
posted @ 2012-07-20 15:46 Wizmann 阅读(294) 评论(1) 推荐(0) 编辑

2012年7月19日

摘要: 我觉得像我这样把所有东西都写的类的ACMer真是一个异类。。。View Code 1 //Result:wizmann 1151 Accepted 832K 0MS G++ 3310B 2 #include <cstdio> 3 #include <cstdlib> 4 #include <cstring> 5 #include <algorithm> 6 #include <string> 7 #include <cmath> 8 #include <vector> 9 #include <set> 阅读全文
posted @ 2012-07-19 23:48 Wizmann 阅读(283) 评论(0) 推荐(0) 编辑

2012年7月15日

摘要: 这题是后辍数组的一个应用。很2B的,到现在还没理解后辍数组的形成原理。IQ不够,人也不勤快。唉。这题很明显的是Height数组的应用,height[i]=common_prefix(sa[i-1],sa[i])我们将str1和str2拼接起来。形成str1+'#'+str2+'&'的形式。然后求出sa[i-1]和sa[i](sa[i-1]和sa[i]属于不同的串)的最长公共前辍,就是题目的最后答案。WA Point:没有在join串的末尾加上特殊标记符,导致求height数组的时候溢出了。。。>_<。。。P.S. 这题MS加数据了,Discu 阅读全文
posted @ 2012-07-15 00:37 Wizmann 阅读(266) 评论(0) 推荐(0) 编辑

2012年7月14日

摘要: 1 unsigned int BKDRHash(char *str) 2 { 3 unsigned int seed = 131; // 31 131 1313 13131 131313 etc.. 4 unsigned int hash = 0; 5 6 while (*str) 7 { 8 hash = hash * seed + (*str++); 9 }10 11 return (hash & 0x7FFFFFFF);12 } 1 unsigned int APHash(char *str) 2 { 3 u... 阅读全文
posted @ 2012-07-14 13:41 Wizmann 阅读(658) 评论(0) 推荐(0) 编辑

2012年7月10日

摘要: //Result:wizmann 2688 Accepted 896K 375MS G++ 3326B 2012-07-10 13:52:30#include <cstdio>#include <cstdlib>#include <cstring>#include <iostream>#include <algorithm>#include <bitset>#include <queue>#include <deque>using namespace std;#define print(x) cou 阅读全文
posted @ 2012-07-10 14:47 Wizmann 阅读(228) 评论(0) 推荐(0) 编辑

2012年7月8日

摘要: #include <cstdio>#include <cstdlib>#include <cstring>#include <iostream>#include <algorithm>#include <cmath>#include <vector>#include <bitset>#include <queue>using namespace std;#define print(x) cout<<x<<endl#define input(x) cin>&g 阅读全文
posted @ 2012-07-08 17:01 Wizmann 阅读(260) 评论(0) 推荐(0) 编辑

2012年7月6日

摘要: View Code 1 #include <cstdio> 2 #include <cstdlib> 3 #include <cstring> 4 #include <algorithm> 5 #include <iostream> 6 #include <stack> 7 #include <vector> 8 #include <bitset> 9 10 using namespace std; 11 12 #define print(x) cout<<x<<endl 1 阅读全文
posted @ 2012-07-06 12:04 Wizmann 阅读(256) 评论(0) 推荐(0) 编辑

2012年7月3日

摘要: UVA Live 5985View Code 1 //Result:1027906 5985 Robbing Gringot... Wizmann Accepted C++ 31.649 2012-07-03 10:04:43 2 #include <cstdio> 3 #include <cstdlib> 4 #include <cstring> 5 #include <algorithm> 6 #include <iostream> 7 #include <bitset> 8 #include <vector&g 阅读全文
posted @ 2012-07-03 18:25 Wizmann 阅读(204) 评论(0) 推荐(0) 编辑

2012年7月2日

摘要: View Code 1 #include <cstdio> 2 #include <cstdlib> 3 #include <cstring> 4 #include <iostream> 5 #include <algorithm> 6 #include <bitset> 7 #include <map> 8 #include <vector> 9 10 using namespace std; 11 typedef long long llint; 12 13 #define print(x) c 阅读全文
posted @ 2012-07-02 15:43 Wizmann 阅读(289) 评论(0) 推荐(0) 编辑

2012年6月29日

摘要: View Code 1 //Result:wizmann 3185 Accepted 728K 16MS G++ 2340B 2 #include <cstdio> 3 #include <cstdlib> 4 #include <cstring> 5 #include <iostream> 6 #include <algorithm> 7 #include <iostream> 8 9 using namespace std; 10 11 #define print(x) cout<<x<<end 阅读全文
posted @ 2012-06-29 21:26 Wizmann 阅读(329) 评论(0) 推荐(0) 编辑

导航