摘要: 在这里,写了一个2-SAT的模板#include#include#include#include#include#include#include#include#include#include#include#define inf 0x0f0f0f0fusing namespace std;con... 阅读全文
posted @ 2014-04-24 20:12 Hust_BaoJia 阅读(117) 评论(0) 推荐(0) 编辑
摘要: Problem DescriptionGiven a two-dimensional array of positive and negative integers, a sub-rectangle is any contiguous sub-array of size 1 x 1 or great... 阅读全文
posted @ 2014-04-24 19:26 Hust_BaoJia 阅读(141) 评论(0) 推荐(0) 编辑
摘要: 这种题目考的是数学功底啊,用脚趾都能想到,任何一个数的长度等于它对10求对数加1;而log10(n!)=log10(1*2*3*4*5********n)=log10(1)+log10(2)+............+log10(n);#include#include#include#include... 阅读全文
posted @ 2014-04-24 18:53 Hust_BaoJia 阅读(115) 评论(0) 推荐(0) 编辑
摘要: Problem DescriptionA number sequence is defined as follows:f(1) = 1, f(2) = 1, f(n) = (A * f(n - 1) + B * f(n - 2)) mod 7.Given A, B, and n, you are t... 阅读全文
posted @ 2014-04-24 17:44 Hust_BaoJia 阅读(131) 评论(0) 推荐(0) 编辑
摘要: 大数相加,这个题我提交了3次才通过,我去,就我这水平,还参加比赛,笑掉别人大牙咯#include#include#includeusing namespace std;char str1[1001],str2[1001];int str3[1001],str4[1001];int main(){ ... 阅读全文
posted @ 2014-04-24 17:16 Hust_BaoJia 阅读(120) 评论(0) 推荐(0) 编辑
摘要: dp方程为这个dp[i][j]=Max(dp[i][j-1]+a[j] , max( dp[i-1][k] ) + a[j] ) 0#includeusing namespace std;const int maxn=1000001;const int inf=99999999;int dp[max... 阅读全文
posted @ 2014-04-24 16:48 Hust_BaoJia 阅读(119) 评论(0) 推荐(0) 编辑
摘要: Problem DescriptionA number whose only prime factors are 2,3,5 or 7 is called a humble number. The sequence 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 14, 15,... 阅读全文
posted @ 2014-04-24 16:02 Hust_BaoJia 阅读(141) 评论(0) 推荐(0) 编辑
摘要: Problem DescriptionNowadays, a kind of chess game called “Super Jumping! Jumping! Jumping!” is very popular in HDU. Maybe you are a good boy, and know... 阅读全文
posted @ 2014-04-24 15:20 Hust_BaoJia 阅读(145) 评论(0) 推荐(0) 编辑
摘要: Problem Description都说天上不会掉馅饼,但有一天gameboy正走在回家的小径上,忽然天上掉下大把大把的馅饼。说来gameboy的人品实在是太好了,这馅饼别处都不掉,就掉落在他身旁的10米范围内。馅饼如果掉在了地上当然就不能吃了,所以gameboy马上卸下身上的背包去接。但由于小径... 阅读全文
posted @ 2014-04-24 15:10 Hust_BaoJia 阅读(129) 评论(0) 推荐(0) 编辑
摘要: Problem DescriptionGiven a sequence a[1],a[2],a[3]......a[n], your job is to calculate the max sum of a sub-sequence. For example, given (6,-1,5,4,-7)... 阅读全文
posted @ 2014-04-24 15:05 Hust_BaoJia 阅读(137) 评论(0) 推荐(0) 编辑
摘要: 今天看了一道hust上的题目,是一道集合上的dp问题,自己写了一个代码,结果连样例都没有过,人生啊,我现在觉得,虽然在hust上做题,做的每一道题都是自己想出来的,可是由于很难找到题解,或者别人AC的代码!故真的很难拓宽自己的知识面,本来想转战POJ的,但是由于个人对POJ的文字排版不怎么喜欢,所以... 阅读全文
posted @ 2014-04-24 14:02 Hust_BaoJia 阅读(122) 评论(0) 推荐(0) 编辑
努力