问题链接:HDU4716 A Computer Graphics Problem。入门练习题,用C语言编写。题意简述:根据输入的数(代表剩余电量,值范围是0到100),打印一个反映剩余电量的字符图案。需要注意的点是,怎样把程序编写得更加简洁,无用的条件判断等要尽可能略...
转载 2016-06-19 21:01:00
26阅读
2评论
问题链接:HDU4716 A Computer Graphics Problem。入门练习题,用C语言编写。题意简述:根据输入的数(代表剩余电量,值范围是0到100),打印一个反映剩余电量的字符图案。需要注意的点是,怎样把程序编写得更加简洁,无用的条件判断等要尽可能略...
转载 2016-06-19 21:01:00
16阅读
2评论
原创 2022-11-10 01:02:36
33阅读
A Computer Graphics Problem Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 693    Accepted Submission(
A Computer Graphics ProblemTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 43Accepted Submission(s): 40Problem DescriptionIn this problem we talk about the study of Computer Graphics. Of course, this is very, very hard.We have designed a new mobile
转载 2013-09-11 17:34:00
69阅读
2评论
题目传送门 1 /* 2 水题:看见x是十的倍数就简单了 3 */ 4 #include 5 #include 6 #include 7 #include 8 #include 9 #include 10 using namespace std;11 12 const int MA...
转载 2015-04-19 20:23:00
102阅读
Problem Description A school bought the first computer some time ago(so this computer's id is 1). During the recent years the school bought N-1 new co
转载 2017-05-18 23:51:00
63阅读
2评论
http://acm.hdu.edu.cn/showproblem.php?pid=2196 题意: 给出一棵树,求出每个点到其他点的最远距离。 思路:对于每一个点,一方面它可以往它的子树方向走,另一方面可以往父亲结点的方向走。所以我们需要两次dfs,第一次用来求出每个点往其子树方向的最远距离和次远
转载 2017-02-12 20:05:00
63阅读
题目链接:[传送门]看不下去的题面:ComputerProblem DescriptionA school
原创 2022-10-25 16:33:57
64阅读
题意: N 个点 N-1条边 每条边有权值 求每个点所能达的最长距离// 树形dp 2次dfs 一次转成有根树、并求出每个子树(以i为根)到叶子节点的最大距离 还有就是从与i相连的个子节点j遍历下去的最大距离 // 其实 每个子树(以i为根)到叶子节点的最大距离 就是 max(child[i][j]);#include #include #include #include #include #include #include using namespace std;#define MOD 1000000007#define maxn 10010vector E[maxn],V[maxn],c.
原创 2021-07-29 16:20:09
80阅读
ComputerTime Limit: 1000msMemory Limit: 32768KBThis problem will be judged onHDU. Original ID:219664-bit integer IO format:%I64d Java class name:MainA...
转载 2015-04-08 14:36:00
63阅读
题意:给出一棵树,求出每个点与距离它最远的点的距离。
转载 2017-04-19 22:25:00
88阅读
2评论
【题目链接】 点击打开链接 【算法】 我们知道,一棵树上离某个节点最远的节点,可能是经过它的祖先,再到那个祖先的某个孩子,或者,是它的那颗子树中,离它最远的一个节点,就不难想到以下算法 : 第一遍DFS,搜出每个节点的子树中离它距离最远的孩子的距离和所经过的儿子,离它次远的孩子的距离和所经过的儿子
转载 2018-05-13 22:47:00
103阅读
2评论
持续强化dp中……ComputerTime Limit: 1000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)
原创 2022-11-22 20:03:21
52阅读
Computer Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 30767 Accepted Submission(s): 3802 Probl
转载 2017-09-04 22:09:00
44阅读
2评论
【题意】 给定一棵树,问对于每个点u,到树上另一个点v的最远距离 【分析】 对于每个u,最远距离要么是向子树方向的,要么是向上走到都一个父亲,再从这个父亲的位置向下走(不能走回来的方向)到的最远位置 显然我们要设计树形dp来解决这个问题,f[u]表示u子树内的最长距离,并记录一下最大的走的是哪个儿子 ...
转载 2021-09-05 16:52:00
95阅读
2评论
Computer HDU - 2196 Computer A school bought the first computer some time ago(so this computer's id is 1). During the recent years the school bought N
转载 2017-06-10 17:58:00
41阅读
2评论
ComputerTime Limit: 1000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 3455    Accepted Submission(s): 1750Problem DescriptionA school bought the f
原创 2023-04-24 09:23:55
65阅读
ComputerTime Limit : 1000/1000ms (Java/Other)Memory Limit : 32768/32768K (Java/Other)Total Submission(s) : 1Accepted Submission(s) : 1Font:Times New Roman|Verdana|GeorgiaFont Size:←→Problem DescriptionA school bought the first computer some time ago(so this computer's id is 1). During the recent
转载 2013-04-30 08:42:00
84阅读
2评论
需要两遍dfs,
原创 2022-08-17 15:39:11
88阅读
  • 1
  • 2
  • 3
  • 4
  • 5