
搜索
文章平均质量分 73
小坏蛋_千千
im0qianqian_站在回忆的河边看着摇晃的渡船终年无声地摆渡,它们就这样安静地画下黄昏画下清晨......
展开
-
YTU 3013: 皇后问题(递归)
3013: 皇后问题(递归)时间限制: 1 Sec 内存限制: 128 MB提交: 2 解决: 2题目描述编写一个函数,求解皇后问题:在n*n的方格棋盘上,放置n个皇后,要求每个皇后不同行、不同列、不同左右对角线。 要求:1、皇后的个数由用户输入,其值不能超过20,输出所有的解。2、采用递归回溯的方法解决。输入原创 2016-04-21 20:47:27 · 1195 阅读 · 0 评论 -
Codeforces 920 E. Connected Components? (bfs)
Description You are given an undirected graph consisting of n vertices and n(n−1)2−m" role="presentation">n(n−1)2−mn(n−1)2−m\frac{n(n-1)}{2}-m edges. Instead of giving you the edges原创 2018-02-06 21:54:08 · 458 阅读 · 0 评论 -
Codeforces 877 D. Olya and Energy Drinks (bfs)
Description Olya loves energy drinks. She loves them so much that her room is full of empty cans from energy drinks. Formally, her room can be represented as a field of n × m cells, each cell of原创 2017-10-26 12:17:26 · 741 阅读 · 0 评论 -
51nod 1109 01组成的N的倍数 (bfs)
Description 给定一个自然数 N ,找出一个 M ,使得 M > 0 且 M 是 N 的倍数,并且 M 的 10 进制表示只包含 0 或 1 ,求最小的 M 。 例如:N = 4,M = 100。 Input 输入 1 个数 N 。(1 <= N <= 10^6) Output 输出符合条件的最小的 M 。 Sample Input4 Sample Outpu原创 2017-09-01 20:24:49 · 527 阅读 · 0 评论 -
Codeforces 842 C. Ilya And The Tree (dfs)
Description Ilya is very fond of graphs, especially trees. During his last trip to the forest Ilya found a very interesting tree rooted at vertex 1. There is an integer number written on each vertex原创 2017-08-30 13:47:31 · 983 阅读 · 0 评论 -
UPC 1053 Mysterious Treasure (记忆化搜索)
Description WNJXYK and DIDIDI is playing a game. DIDIDI draws a directed graph G on the paper which contains n points, m directed edges and no cycle. WNJXYK starts from point 1. For every round, WNJX原创 2017-08-27 17:28:22 · 608 阅读 · 2 评论 -
hiho一下 第156周 岛屿 (dfs)
描述 给你一张某一海域卫星照片,你需要统计: 照片中海岛的数目 照片中面积不同的海岛数目 照片中形状不同的海岛数目 其中海域的照片如下,”.”表示海洋,”#”表示陆地。在”上下左右”四个方向上连在一起的一片陆地组成一座岛屿。 .####.......#.####.#......#...##.#. 上图所示的照片中一共有4座岛屿;其中3座面原创 2017-06-26 21:16:57 · 771 阅读 · 0 评论 -
HZAU 1208 Color Circle (dfs)
Description There are colorful flowers in the parterre in front of the door of college and form many beautiful patterns. Now, you want to find a circle consist of flowers with same color. What should原创 2017-04-24 17:20:17 · 526 阅读 · 0 评论 -
POJ 2531 Network Saboteur (DFS)
Description A university network is composed of N computers. System administrators gathered information on the traffic between nodes, and carefully divided the network into two subnetworks in order t原创 2017-01-29 19:51:34 · 591 阅读 · 0 评论 -
POJ 3414 Pots (BFS)
Description You are given two pots, having the volume of A and B liters respectively. The following operations can be performed: FILL(i) fill the pot i (1 ≤ i ≤ 2) from the tap; DROP原创 2017-01-27 21:47:59 · 293 阅读 · 0 评论 -
POJ 1426 Find The Multiple (BFS)
Description Given a positive integer n, write a program to find out a nonzero multiple m of n whose decimal representation contains only the digits 0 and 1. You may assume that n is not greater than原创 2017-01-27 20:28:25 · 436 阅读 · 0 评论 -
POJ 2251 Dungeon Master (BFS)
Description You are trapped in a 3D dungeon and need to find the quickest way out! The dungeon is composed of unit cubes which may or may not be filled with rock. It takes one minute to move one unit原创 2017-01-26 14:37:48 · 394 阅读 · 0 评论 -
POJ 2488 A Knight's Journey (dfs)
Description Background The knight is getting bored of seeing the same black and white squares again and again and has decided to make a journey around the world. Whenever a knight moves,原创 2017-01-24 22:45:14 · 369 阅读 · 0 评论 -
POJ 3278 Catch That Cow (BFS)
Description Farmer John has been informed of the location of a fugitive cow and wants to catch her immediately. He starts at a point N (0 ≤ N ≤ 100,000) on a number line and the cow is at a point K (原创 2017-01-22 15:50:55 · 434 阅读 · 0 评论 -
POJ 3126 Prime Path (BFS)
Description The ministers of the cabinet were quite upset by the message from the Chief of Security stating that they would all have to change the four-digit room numbers on their offices. — It原创 2017-02-07 16:25:41 · 404 阅读 · 0 评论 -
POJ 2676 Sudoku1 (DFS)
Description Sudoku is a very simple task. A square table with 9 rows and 9 columns is divided to 9 smaller squares 3x3 as shown on the Figure. In some of the cells are written decimal digits from 1 t原创 2017-02-07 15:07:46 · 496 阅读 · 0 评论 -
POJ 2785:4 Values whose Sum is 0 (双向BFS)
4 Values whose Sum is 0Time Limit: 15000MS Memory Limit: 228000KTotal Submissions: 20020 Accepted: 5977Case Time Limit: 5000MSDescriptionThe SUM problem原创 2016-08-11 21:43:17 · 492 阅读 · 0 评论 -
HDU 1312:Red and Black
Red and BlackTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 17510 Accepted Submission(s): 10642Problem DescriptionThere is a原创 2016-07-28 17:05:35 · 508 阅读 · 0 评论 -
Codeforces 763 A. Timofey and a tree (dfs)
Description Each New Year Timofey and his friends cut down a tree of n vertices and bring it home. After that they paint all the n its vertices, so that the i-th vertex gets color ci. Now it’原创 2018-02-07 21:57:37 · 392 阅读 · 0 评论