随笔分类 -  acm搜索bfs dfs

摘要:#include<iostream> #include<algorithm> #include<cmath> #include<cstring> #include<string> using namespace std; const int maxn=1000000; int sum[maxn]; 阅读全文
posted @ 2019-10-10 00:40 coolwx 阅读(128) 评论(0) 推荐(0)
摘要:#include <iostream> #include <cstdio> #include <algorithm> #include <vector> using namespace std; struct edge{ int to,cost; }; struct edge2{ int id,fr 阅读全文
posted @ 2019-07-12 17:24 coolwx 阅读(133) 评论(0) 推荐(0)
摘要:给定一个m × n (m行, n列)的迷宫,迷宫中有两个位置,gloria想从迷宫的一个位置走到另外一个位置,当然迷宫中有些地方是空地,gloria可以穿越,有些地方是障碍,她必须绕行,从迷宫的一个位置,只能走到与它相邻的4个位置中,当然在行走过程中,gloria不能走到迷宫外面去。令人头痛的是,g 阅读全文
posted @ 2019-07-06 23:15 coolwx 阅读(129) 评论(0) 推荐(0)
摘要:George took sticks of the same length and cut them randomly until all parts became at most 50 units long. Now he wants to return sticks to the origina 阅读全文
posted @ 2019-07-06 21:25 coolwx 阅读(181) 评论(0) 推荐(0)
摘要:大家一定觉的运动以后喝可乐是一件很惬意的事情,但是seeyou却不这么认为。因为每次当seeyou买了可乐以后,阿牛就要求和seeyou一起分享这一瓶可乐,而且一定要喝的和seeyou一样多。但seeyou的手中只有两个杯子,它们的容量分别是N 毫升和M 毫升 可乐的体积为S (S<101)毫升 ( 阅读全文
posted @ 2019-07-03 00:45 coolwx 阅读(133) 评论(0) 推荐(0)
摘要:You are given a rooted tree with n vertices. The vertices are numbered from 1 to n, the root is the vertex number 1. Each vertex has a color, let's de 阅读全文
posted @ 2019-07-02 23:15 coolwx 阅读(225) 评论(0) 推荐(0)
摘要:A ring is compose of n circles as shown in diagram. Put natural number 1, 2, ..., n into each circle separately, and the sum of numbers in two adjacen 阅读全文
posted @ 2019-07-02 22:24 coolwx 阅读(190) 评论(0) 推荐(0)
摘要:题目: Michael喜欢滑雪百这并不奇怪, 因为滑雪的确很刺激。可是为了获得速度,滑的区域必须向下倾斜,而且当你滑到坡底,你不得不再次走上坡或者等待升降机来载你。Michael想知道载一个区域中最长底滑坡。区域由一个二维数组给出。数组的每个数字代表点的高度。下面是一个例子 1 2 3 4 5 16 阅读全文
posted @ 2019-07-02 22:22 coolwx 阅读(401) 评论(0) 推荐(0)