
搜索
文章平均质量分 89
xieshimao
topcoder
展开
-
leetcode 37.解数独 【深度搜索+剪枝】
leetcode 37.解数独题解,搜索以及剪枝原创 2023-02-08 11:01:26 · 547 阅读 · 1 评论 -
LeetCode 834.树中距离之和 Sum of distance in tree
LeetCode 834.树中距离之和 Sum of distance in tree给定一个无向、连通的树。树中有 N 个标记为 0...N-1 的节点以及 N-1 条边 。第 i 条边连接节点 edges[i][0] 和 edges[i][1] 。返回一个表示节点 i 与其他所有节点距离之和的列表 ans。示例 1:输入: N = 6, edges = [[0,1],[0,2...原创 2018-10-09 11:02:51 · 1355 阅读 · 1 评论 -
LeetCode 919 完全二叉树插入器 complete binary tree inserter
完全二叉树是每一层(除最后一层外)都是完全填充(即,结点数达到最大)的,并且所有的结点都尽可能地集中在左侧。设计一个用完全二叉树初始化的数据结构 CBTInserter,它支持以下几种操作:CBTInserter(TreeNode root) 使用头结点为 root 的给定树初始化该数据结构;CBTInserter.insert(int v) 将 TreeNode 插入到存在值为 node....原创 2018-10-11 15:47:03 · 597 阅读 · 0 评论 -
lintcode 1259. Integer Replacement 搜索
描述Given a positive integer n and you can do operations as follow:1.If n is even, replace n with n/2.2.If n is odd, you can replace n with either n + 1 or n - 1.What is the minimum number of rep...原创 2018-09-13 14:31:04 · 260 阅读 · 0 评论 -
Codeforces Round #178 (Div. 2) B Shaass and Bookshelf
B. Shaass and Bookshelftime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputShaass has n books. He wants to mak原创 2013-04-08 02:51:07 · 3125 阅读 · 0 评论 -
HDU 1195 BFS,双向BFS两种写法
Open the LockTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 1788 Accepted Submission(s): 747Problem DescriptionNow an emergent t原创 2012-05-16 16:59:22 · 4493 阅读 · 0 评论 -
HDU 4133 反素数
StrangeStandardTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 70 Accepted Submission(s): 31Problem DescriptionNowadays, WHUACMer原创 2011-12-07 18:32:21 · 2544 阅读 · 0 评论 -
POJ 2976 参数搜索
Dropping testsTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 3042 Accepted: 964DescriptionI原创 2011-02-19 19:01:00 · 1576 阅读 · 0 评论 -
HDU 1181 搜索
变形课Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072/65536 K (Java/Others)Total Submission(s): 4587 Accepted Submission(原创 2011-09-27 16:22:22 · 1215 阅读 · 0 评论 -
HDOJ/HDU 1142 A Walk Through the Forest
A Walk Through the ForestTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 2292原创 2011-09-19 14:11:14 · 1352 阅读 · 0 评论 -
POJ 1207 HDOJ/HDU 1032 3n+1数链问题 绝对不水的解法
The 3n + 1 problemTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 39115 Accepted: 12294Descripti原创 2011-09-14 15:36:58 · 3073 阅读 · 4 评论 -
湖南省省赛 e题 二分 内部收益率
<br />内部收益率<br />Time Limit:1000MS Memory Limit:65536K<br />Total Submit:12 Accepted:7 <br />Description<br />在金融中,我们有时会用内部收益率IRR来评价项目的投资财务原创 2010-12-10 22:35:00 · 2860 阅读 · 4 评论 -
四川省ACM省赛B题,优先队列+BFS Charitable Exchange
题目链接:http://acm.uestc.edu.cn/problem.php?pid=1558&cid=129 Description Have you ever heard a star cha原创 2011-07-23 23:44:01 · 3260 阅读 · 2 评论 -
POJ 3984 顶嵌杯决赛 B题
迷宫问题Time Limit: 1000MS Memory Limit: 65536KTotal Submissions: 990 Accepted: 498<br />Description定义一个二维数组: <br /><br />int maze[5][5] = {<br原创 2010-12-04 18:16:00 · 1097 阅读 · 0 评论 -
ZOJ 1530 构造一个只由01构成的整数,并且可以整除n
<br />题目连接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=530<br /> <br />我的方法是直接利用BFS暴力搜索<br /> <br />我的代码:<br />Source<br />Problem Id:1690 User Id:bingshen <br />Memory:4276K Time:953MS<br />Language:G++ Result:AcceptedSource<br />#includ原创 2011-05-17 20:52:00 · 1375 阅读 · 0 评论 -
POJ 3258 二分算法
<br />题目链接:http://poj.org/problem?id=3258<br /> <br />题意:有一条河流,上面原来有n个石头,FJ的cow可以从这些石头上跳过去,现在FJ想训练他的cow的跳跃能力,于是乎想移去其中的m个石头,而且他要求,去掉这m个石头后,石头与石头之间的最小值必须最大。<br /> <br />思路:二分答案,然后验证当前答案下最少需要移去的石头数量<br /> <br />my ugly code:<br />Source Code<br />Problem:3258原创 2011-03-18 13:45:00 · 1083 阅读 · 1 评论 -
POJ 3697 BFS暴力
USTC campus networkTime Limit: 4000MS Memory Limit: 65536KTotal Submissions: 3316 Accepted: 1023<br />Description<br />USTC campus network is a huge network. There is a bi-directional link between every pair of computers in the network. One of the computer原创 2011-03-10 19:02:00 · 1763 阅读 · 0 评论 -
POJ 2631 最长路搜索,BFS
Roads in the NorthTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 1352 Accepted: 666<br />DescriptionBuilding and maintaining roads among communities in the far North is an expensive business. With this in mind, the roads are build such that ther原创 2011-02-19 20:38:00 · 1590 阅读 · 0 评论 -
Robot in Maze
<br />Robot in Maze<br />Time Limit:1000MS Memory Limit:65536K<br />Total Submit:42 Accepted:15 <br />Description<br />There is a robot trapped in the maze. Now you have to send out some instructions, telling it how to reach its destination. <br /><br />T原创 2010-12-15 16:24:00 · 1757 阅读 · 0 评论