wanide
wanide
全部文章
C语言
2018蓝桥杯(7)
dp(3)
hdu(3)
Java(13)
KMP(1)
POJ(3)
字符串(2)
并查集(2)
数据结构(5)
最小生成树(2)
最短路(5)
未归档(100)
深度优先搜索/广度优先搜索(4)
贪心(1)
归档
标签
去牛客网
登录
/
注册
仙女的博客
面朝大海,然后春暖花开
全部文章
/ C语言
(共77篇)
关于搜索(DFS 、BFS)
深度优先搜索(DFS): 思想: 首先以一个未被访问过的顶点作为开始顶点,沿当前顶点的边走到未访问过的顶点;当没有未访问过的顶点时,则回溯到上一个顶点,继续试探访问别的顶点,直到所有的顶点都被访问过。 完整代码: #include<stdio.h>...
2018-07-21
0
302
HDU 2033 - 人见人爱A+B
Problem Description HDOJ上面已经有10来道A+B的题目了,相信这些题目曾经是大家的最爱,希望今天的这个A+B能给大家带来好运,也希望这个题目能唤起大家对ACM曾经的热爱。 这个题目的A和B不是简单的整数,而是两个时间,A和B 都是由3个整数组成,分别表示时分秒,比如,假设A...
2018-07-20
0
329
HDU 2717 - Catch That Cow (BFS)
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 numb...
2018-07-20
0
284
HDU 2029 - Palindromes _easy version0 ( 回文串)
Problem Description “回文串”是一个正读和反读都一样的字符串,比如“level”或者“noon”等等就是回文串。请写一个程序判断读入的字符串是否是“回文”。 Input 输入包含多个测试实例,输入数据的第一行是一个正整数n,表示测试实例的个数,后面紧跟着是n个字符串。...
2018-07-19
0
318
HDU 2028 - Lowest Common Multiple Plus (最小公倍数)
Problem Description 求n个数的最小公倍数。 Input 输入包含多个测试实例,每个测试实例的开始是一个正整数n,然后是n个正整数。 Output 为每组测试数据输出它们的最小公倍数,每个测试实例的输出占一行。你可以假设最后的输出是一个32位的整数。 ...
2018-07-19
0
638
POJ 1082 - Calendar Game
Adam and Eve enter this year's ACM International Collegiate Programming Contest. Last night, they played the Calendar Game, in celebration of this con...
2018-07-19
0
232
博弈问题
一、尼姆博奕(Nimm Game): 有N堆石头,每堆石头数目在1到100之间,最多有10堆.两人分别取走石头.取石头的规则是:每次只能从1堆中取,每次取走至少1个。取过后还可以把这堆的石头任意分配到其它石子数不为0的堆上,当然也可以不分配。问给定这些石头堆的情况,两人轮流取,谁取走...
2018-07-19
0
625
HDU 1527 - 取石子游戏 (威佐夫博奕(Wythoff Game))
有两堆石子,数量任意,可以不同。游戏开始由两个人轮流取石子。游戏规定,每次有两种不同的取法,一是可以在任意的一堆中取走任意多的石子;二是可以在两堆中同时取走相同数量的石子。最后把石子全部取完者为胜者。现在给出初始的两堆石子的数目,如果轮到你先取,假设双方都采取最好的策略,问最后你是胜者还是败者。 ...
2018-07-19
0
305
POJ 2234 - Matches Game (尼姆博奕(Nimm Game))
Here is a simple game. In this game, there are several piles of matches and two players. The two player play in turn. In each turn, one can choose a p...
2018-07-19
0
382
POJ 1740 - A New Stone Game (Nim博弈变形)
Alice and Bob decide to play a new stone game.At the beginning of the game they pick n(1<=n<=10) piles of stones in a line. Alice and Bob move t...
2018-07-19
0
288
首页
上一页
1
2
3
4
5
6
7
8
下一页
末页