![](https://img-blog.csdnimg.cn/20201014180756757.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
HDU
这个好玩吗
Offer已在路上请耐心等待,准备入职的新人
展开
-
HDU - 1018.Big Number
Big NumberTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 36443 Accepted Submission(s): 17451Problem DescriptionIn many appli原创 2017-01-18 13:07:02 · 238 阅读 · 0 评论 -
HDU-1160 FatMouse's Speed
FatMouse believes that the fatter a mouse is, the faster it runs. To disprove this, you want to take the data on a collection of mice and put as large a subset of this data as possible into a sequence...原创 2018-04-30 21:07:11 · 101 阅读 · 0 评论 -
HDU-1421 搬寝室
搬寝室是很累的,xhd深有体会.时间追述2006年7月9号,那天xhd迫于无奈要从27号楼搬到3号楼,因为10号要封楼了.看着寝室里的n件物品,xhd开始发呆,因为n是一个小于2000的整数,实在是太多了,于是xhd决定随便搬2*k件过去就行了.但还是会很累,因为2*k也不小是一个不大于n的整数.幸运的是xhd根据多年的搬东西的经验发现每搬一次的疲劳度是和左右手的物品的重量差的平方成正比(这里补充...原创 2018-04-30 21:09:02 · 125 阅读 · 0 评论 -
HDU-1496 Equations
Consider equations having the following form: a*x1^2+b*x2^2+c*x3^2+d*x4^2=0 a, b, c, d are integers from the interval [-50,50] and any of them cannot be 0. It is consider a solution a system ( x1,x2,x...原创 2018-04-30 21:11:51 · 266 阅读 · 0 评论 -
HDU-1576 A/B
要求(A/B)%9973,但由于A很大,我们只给出n(n=A%9973)(我们给定的A必能被B整除,且gcd(B,9973) = 1)。Input数据的第一行是一个T,表示有T组数据。 每组数据有两个数n(0 <= n < 9973)和B(1 <= B <= 10^9)。Output对应每组数据输出(A/B)%9973。Sample Input21000 5387 12...原创 2018-04-30 21:14:12 · 209 阅读 · 0 评论 -
HDU-1269 迷宫城堡
为了训练小希的方向感,Gardon建立了一座大城堡,里面有N个房间(N<=10000)和M条通道(M<=100000),每个通道都是单向的,就是说若称某通道连通了A房间和B房间,只说明可以通过这个通道由A房间到达B房间,但并不说明通过它可以由B房间到达A房间。Gardon需要请你写个程序确认一下是否任意两个房间都是相互连通的,即:对于任意的i和j,至少存在一条路径可以从房间i到房间j,...原创 2018-04-30 21:20:03 · 138 阅读 · 0 评论 -
HDU-3836 Equivalent Sets
To prove two sets A and B are equivalent, we can first prove A is a subset of B, and then prove B is a subset of A, so finally we got that these two sets are equivalent.You are to prove N sets are equ...原创 2018-04-30 21:24:31 · 169 阅读 · 0 评论 -
HDU-1878 欧拉回路
欧拉回路是指不令笔离开纸面,可画过图中每条边仅一次,且可以回到起点的一条回路。现给定一个图,问是否存在欧拉回路?Input测试输入包含若干测试用例。每个测试用例的第1行给出两个正整数,分别是节点数N ( 1 < N < 1000 )和边数M;随后的M行对应M条边,每行给出一对正整数,分别是该条边直接连通的两个节点的编号(节点从1到N编号)。当N为0时输入结 束。Output每个测试用例...原创 2018-05-03 22:57:38 · 311 阅读 · 0 评论 -
HDU-1116 Play on Words
Some of the secret doors contain a very interesting word puzzle. The team of archaeologists has to solve it to open that doors. Because there is no other way to open the doors, the puzzle is very impo...原创 2018-05-03 22:59:07 · 159 阅读 · 0 评论 -
HDU-4556 Stern-Brocot Tree
上图是一棵Stern-Brocot树,其生成规则如下: 从第1行到第n行,每行相邻两数a/b和c/d,产生中间数(a+c)/(b+d),置于下一行中。将一行的分数(包括0/1,1/0),进行约分简化,则每一行(包括0/1,1/0,1/1),不会出现两个相同的分数。若分子或者分母大于n,则去掉该分数,将剩下的分数,从小到大排序,得到数列F。 现在请您编程计算第n行的数列F的个数。 ...原创 2018-05-03 23:00:09 · 208 阅读 · 0 评论 -
HDU-2824 The Euler function
The Euler function phi is an important kind of function in number theory, (n) represents the amount of the numbers which are smaller than n and coprime to n, and this function has a lot of beautiful c...原创 2018-05-03 23:01:09 · 202 阅读 · 0 评论 -
HDU-1370 Biorhythms
Some people believe that there are three cycles in a person's life that start the day he or she is born. These three cycles are the physical, emotional, and intellectual cycles, and they have periods ...原创 2018-05-03 23:02:15 · 394 阅读 · 0 评论 -
HDU-1532 Drainage Ditches
Every time it rains on Farmer John's fields, a pond forms over Bessie's favorite clover patch. This means that the clover is covered by water for awhile and takes quite a long time to regrow. Thus, Fa...原创 2018-05-03 23:08:19 · 175 阅读 · 0 评论 -
HDU-1533 Going Home
On a grid map there are n little men and n houses. In each unit time, every little man can move one unit step, either horizontally, or vertically, to an adjacent point. For each little man, you need t...原创 2018-05-03 23:10:22 · 228 阅读 · 0 评论 -
HDU-4540 威威猫系列故事——打地鼠
威威猫最近不务正业,每天沉迷于游戏“打地鼠”。 每当朋友们劝他别太着迷游戏,应该好好工作的时候,他总是说,我是威威猫,猫打老鼠就是我的工作! 无话可说... 我们知道,打地鼠是一款经典小游戏,规则很简单:每隔一个时间段就会从地下冒出一只或多只地鼠,玩游戏的人要做的就是打地鼠。 假设: 1、每一个时刻我们只能打一只地鼠,并且打完以后该时刻出现的所有地鼠都会立刻消失; 2...原创 2018-04-30 21:04:58 · 202 阅读 · 0 评论 -
HDU-1176 免费馅饼
都说天上不会掉馅饼,但有一天gameboy正走在回家的小径上,忽然天上掉下大把大把的馅饼。说来gameboy的人品实在是太好了,这馅饼别处都不掉,就掉落在他身旁的10米范围内。馅饼如果掉在了地上当然就不能吃了,所以gameboy马上卸下身上的背包去接。但由于小径两侧都不能站人,所以他只能在小径上接。由于gameboy平时老呆在房间里玩游戏,虽然在游戏中是个身手敏捷的高手,但在现实中运动神经特别迟钝...原创 2018-04-30 21:03:23 · 121 阅读 · 0 评论 -
HDU - 1800 Flying to the Mars
#include #include #include #include #include #define MAX 3000 + 10using namespace std;typedef struct node { struct node* next[10]; int num; bool isLeaf;} Node;int Max = 0;No原创 2017-05-17 21:47:53 · 364 阅读 · 0 评论 -
HDU - 4548.美素数
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4548考查素数打表#include #define MAX 1000000 + 10int prime[MAX];int table[MAX];int getSum( int n ) { int sum = 0; while( n ) {原创 2017-01-20 09:43:17 · 258 阅读 · 0 评论 -
HDU - 2795 Billboard
题目大意: 有一块h*w的矩形广告板,要往上面贴广告; 然后给n个1*wi的广告,要求把广告贴上去; 而且要求广告要尽量往上贴并且尽量靠左; 求第n个广告的所在的位置,不能贴则为-1; 算法思想: 利用线段树可以求区间的最大值; 将位置即h用来建树(h树中存储的为该位置还拥有的空间; 若左子树的最大值大于他,就查询左子树,否则查询右子树;原创 2017-05-23 15:34:03 · 279 阅读 · 0 评论 -
HDU - 3549 Flow Problem
#include #include #include #include #include #define MAX 500#define INF 0x3fffffffusing namespace std;int c[MAX][MAX];int flow[MAX];int pre[MAX];int n, m;void init( int n ) { memse原创 2017-05-23 15:40:19 · 240 阅读 · 0 评论 -
HDU-1251 统计难题
考查Trie树,用G++提交会超内存,原因不详,C++提交AC// Tire树// 用G++提交会超内存,具体原因不详// 用C++提交AC#include #include #include #include #include using namespace std;typedef struct node { struct node* next[26];原创 2017-05-09 10:22:26 · 355 阅读 · 1 评论 -
HDU-1241 Oil Deposits
dfs搜索,统计连通块数量#include #include #include #define MAX 100 + 10using namespace std;char MGraph[MAX][MAX];int dir[8][2] = { { -1, -1 }, { -1, 0 }, { -1, 1 }, { 0, -1 }, { 0, 1原创 2017-05-09 10:20:43 · 316 阅读 · 0 评论 -
HDU-1023 Train Problem II
考查数论——卡特兰数// 卡特兰数import java.math.BigInteger;import java.util.Scanner;public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); BigInteger原创 2017-05-09 10:17:58 · 370 阅读 · 0 评论 -
HDU-1004 Let the Balloon Rise
可以用map做,这里用的是Trie树#include #include #include #include using namespace std;typedef struct node { struct node* next[26]; int value; int num;} Node;Node* createTrie() { Node*原创 2017-05-09 10:16:25 · 405 阅读 · 0 评论 -
HDU - 1284. 钱币兑换问题
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1284考查完全背包,入门题。不太懂得这个转移方程可以看下这个:http://blog.csdn.net/u013480600/article/details/40477769/*转移方程: f[i][j] = sum( f[i-1][j], f[i][j - val[i]] )原创 2017-02-05 15:36:24 · 547 阅读 · 0 评论 -
HDU - 1086.You can Solve a Geometry Problem too
链接:http://acm.hdu.edu.cn/showproblem.php?pid=1086考查判断线段相交,今天刚好学习了一下,拿来练练手。#include #define MAX 100 + 10typedef struct { double x; double y;} Node;Node node[MAX];Node point[MAX]原创 2017-02-04 19:21:28 · 333 阅读 · 0 评论 -
HDU - 1754.I Hate It
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1754考查线段树。今天刚学习了线段树的知识,看的一知半解...大概原理了解了,拿一道简单题练手下。#include #define MAX ( 200000 + 10 )int num[MAX];typedef struct { int left; i原创 2017-01-20 17:33:53 · 263 阅读 · 0 评论 -
HDU - 1166.敌兵布阵
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1166考查树状数组。#include #include #include #include #define MAX 50000 + 10using namespace std;//int a[MAX];int c[MAX];int lowbit( int原创 2017-01-20 09:24:33 · 305 阅读 · 0 评论 -
HDU - 1556 Color the ball
树状数组练习,模版题#include #define MAX 100000 + 10typedef long long LL;LL a[MAX];LL lowbit( LL x ) { return x & ( -x );}LL getSum( LL x ) { LL s = 0; while( x > 0 ) { printf(原创 2017-05-13 14:20:26 · 406 阅读 · 0 评论 -
HDU - 2689 Sort it
题目统计逆序数的数量,可以用归并排序。这里利用树状数组求逆序数// 树状数组求逆序数#include #include #define MAX 1000 + 10typedef long long LL;LL c[MAX];LL lowbit( LL i ) { return i & ( -i );}void update( LL i, LL val, LL原创 2017-05-13 14:21:51 · 419 阅读 · 0 评论 -
HDU-4738 Caocao's Bridges
Caocao was defeated by Zhuge Liang and Zhou Yu in the battle of Chibi. But he wouldn't give up. Caocao's army still was not good at water battles, so he came up with another idea. He built many island...原创 2018-05-04 23:51:31 · 300 阅读 · 0 评论