摘要:
import java.io.*;import java.util.*; import java.math.*;import java.lang.*;import java.text.*; class Main{ public static void main(String[] argc) { Scanner cin=new Scanner(System.in); BigInteger a,b,sum; a=BigInteger.valueOf(0); b=BigInteger.valueOf(0); sum=BigInteger.valueOf(0); int n,i=1; n=cin.ne 阅读全文
摘要:
蟠桃记Time Limit : 2000/1000ms (Java/Other)Memory Limit : 65536/32768K (Java/Other)Total Submission(s) : 4Accepted Submission(s) : 4Font: Times New Roman | Verdana | GeorgiaFont Size: ← →Problem Description喜欢西游记的同学肯定都知道悟空偷吃蟠桃的故事,你们一定都觉得这猴子太闹腾了,其实你们是有所不知:悟空是在研究一个数学问题!什么问题?他研究的问题是蟠桃一共有多少个!不过,到最后,他还是没能解决这 阅读全文
摘要:
骨牌铺方格Problem Description在2×n的一个长方形方格中,用一个1× 2的骨牌铺满方格,输入n ,输出铺放方案的总数.例如n=3时,为2× 3方格,骨牌的铺放方案有三种,如下图: Input输入数据由多行组成,每行包含一个整数n,表示该测试实例的长方形方格的规格是2×n (0<n<=50)。Output对于每个测试实例,请输出铺放方案的总数,每个实例的输出占一行。Sample Input132Sample Output132#include<iostream>using namespace std;int mai 阅读全文
摘要:
排序Time Limit : 2000/1000ms (Java/Other)Memory Limit : 65536/32768K (Java/Other)Total Submission(s) : 8Accepted Submission(s) : 5Font: Times New Roman | Verdana | GeorgiaFont Size: ← →Problem Description输入一行数字,如果我们把这行数字中的‘5’都看成空格,那么就得到一行用空格分割的若干非负整数(可能有些整数以‘0’开头,这些头部的‘0’应该被忽略掉,除非这个整数就是由若干个‘0’组成的,这时这个 阅读全文
摘要:
Sum ProblemTime Limit: 1000/500 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 164763Accepted Submission(s): 38888Problem DescriptionHey, welcome to HDOJ(Hangzhou Dianzi University Online Judge).In this problem, your task is to calculate SUM(n) = 1 + 2 + 3 + ... + n.In 阅读全文
摘要:
并查集小结并查集大体分为三个:普通的并查集,带种类的并查集,扩展的并查集(主要是必须指定合并时的父子关系,或者统计一些数据,比如此集合内的元素数目。)POJ-1182经典的种类并查集POJ-1308用并查集来判断一棵树。。注意空树也是树,死人也是人。POJ-1611裸地水并查集POJ-1703种类并查集POJ-1988看上去似乎和种类并查集无关,但其实仔细想想,就是种类并查集。。。只不过是种类数目无穷大,通过合并,可以确定两个物品之间的种类差(即高度差)POJ-2236裸地并查集,小加一点计算几何POJ-2492裸地种类并查集POJ-2524又是裸地并查集POJ-1456常规思想是贪心+堆优化 阅读全文
摘要:
Super Jumping! Jumping! Jumping!Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 12982Accepted Submission(s): 5379Problem DescriptionNowadays, a kind of chess game called “Super Jumping! Jumping! Jumping!” is very popular in HDU. Maybe you are a goo 阅读全文
摘要:
Bone CollectorTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 13436Accepted Submission(s): 5273Problem DescriptionMany years ago , in Teddy’s hometown there was a man who was called “Bone Collector”. This man like to collect varies of bones , such 阅读全文
摘要:
City GameTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 2464Accepted Submission(s): 997Problem DescriptionBob is a strategy game programming specialist. In his new city building game the gaming environment is as follows: a city is built up by area 阅读全文
摘要:
Largest Rectangle in a HistogramTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 5335Accepted Submission(s): 1523Problem DescriptionA histogram is a polygon composed of a sequence of rectangles aligned at a common base line. The rectangles have equa 阅读全文