常见算法&&水题
入门学习编程
初吻--给了奶嘴
梦想是什么?梦想就是做的美梦与无限遐想。。。。(开玩笑的)
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
N皇后问题 HDU - 2553
N皇后问题 HDU - 2553 在N*N的方格棋盘放置了N个皇后,使得它们不相互攻击(即任意2个皇后不允许处在同一排,同一列,也不允许处在与棋盘边框成45角的斜线上。 你的任务是,对于给定的N,求出有多少种合法的放置方法。 Input共有若干行,每行一个正整数N≤10,表示棋盘和皇后的数量;如果N=0,表示结束。Output共有若干行,每行一个正整数,表示对应原创 2017-08-16 09:27:10 · 317 阅读 · 0 评论 -
Sudoku POJ - 2676(数独)
Sudoku POJ - 2676Sudoku 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 dig原创 2017-08-16 09:23:22 · 451 阅读 · 0 评论 -
1160 蛇形矩阵
1160 蛇形矩阵题目描述 Description小明玩一个数字游戏,取个n行n列数字矩阵(其中n为不超过100的奇数),数字的填补方法为:在矩阵中心从1开始以逆时针方向绕行,逐圈扩大,直到n行n列填满数字,请输出该n行n列正方形矩阵以及其的对角线数字之和.输入描述 Input Descriptionn(即n行n列)输出描述原创 2017-08-14 09:38:56 · 460 阅读 · 0 评论 -
The order of a Tree HDU - 3999
The order of a Tree HDU - 3999 As we know,the shape of a binary search tree is greatly related to the order of keys we insert. To be precisely: 1. insert a key k to a empty tree, then the t原创 2017-08-11 11:09:42 · 393 阅读 · 0 评论 -
Binary Tree Traversals HDU - 1710 (二叉树求后序)
Binary Tree Traversals HDU - 1710 A binary tree is a finite set of vertices that is either empty or consists of a root r and two disjoint binary trees called the left and right subtrees. There a原创 2017-08-11 10:12:01 · 316 阅读 · 0 评论 -
Genealogical tree POJ - 2367(拓扑模板)
Genealogical tree POJ - 2367The system of Martians' blood relations is confusing enough. Actually, Martians bud when they want and where they want. They gather together in different gr原创 2017-08-03 09:24:32 · 304 阅读 · 0 评论 -
Wooden Sticks HDU - 1051 (贪心)
Wooden Sticks HDU -1051 There is a pile of n wooden sticks. The length and weight of each stick are known in advance. The sticks are to be processed by a woodworking machine in one by one fash原创 2017-07-27 21:22:57 · 395 阅读 · 0 评论 -
昂贵的聘礼 POJ - 1062 (Dijkstra)
昂贵的聘礼 POJ - 1062年轻的探险家来到了一个印第安部落里。在那里他和酋长的女儿相爱了,于是便向酋长去求亲。酋长要他用10000个金币作为聘礼才答应把女儿嫁给他。探险家拿不出这么多金币,便请求酋长降低要求。酋长说:"嗯,如果你能够替我弄到大祭司的皮袄,我可以只要8000金币。如果你能够弄来他的水晶球,那么只要5000金币就行了。"探险家就跑到大祭司那里,向他要求皮袄或水晶球,大原创 2017-07-25 19:16:31 · 503 阅读 · 0 评论 -
Meteor Shower POJ - 3669
Meteor Shower POJ - 3669 Bessie hears that an extraordinary meteor shower is coming; reports say that these meteors will crash into earth and destroy anything they hit. Anxious for her原创 2017-07-21 11:15:55 · 289 阅读 · 0 评论 -
Five-In-a-Row CodeForces - 825B
Five-In-a-Row CodeForces - 82Alice and Bob play 5-in-a-row game. They have a playing field of size 10 × 10. In turns they put either crosses or noughts, one at a time. Alice puts crosses and Bob原创 2017-07-20 19:17:12 · 609 阅读 · 0 评论 -
find the most comfortable road HDU - 1598 (并查集)
find the most comfortable road HDU - 1598 XX星有许多城市,城市之间通过一种奇怪的高速公路SARS(Super Air Roam Structure---超级空中漫游结构)进行交流,每条SARS都对行驶在上面的Flycar限制了固定的Speed,同时XX星人对 Flycar的“舒适度”有特殊要求,即乘坐过程中最高速度与最低速度原创 2017-07-20 15:48:24 · 319 阅读 · 0 评论 -
C语言:小希的迷宫 HDU - 1272 (并查集——检验是否有回路)
小希的迷宫HDU - 1272上次Gardon的迷宫城堡小希玩了很久(见Problem B),现在她也想设计一个迷宫让Gardon来走。但是她设计迷宫的思路不一样,首先她认为所有的通道都应该是双向连通的,就是说如果有一个通道连通了房间A和B,那么既可以通过它从房间A走到房间B,也可以通过它从房间B走到房间A,为了提高难度,小希希望任意两个房间有且仅有一条路径可以相通(除非走原创 2017-07-20 11:12:48 · 533 阅读 · 0 评论 -
Highways --(Kruskal和prim)C - Highways POJ - 1751
Highways POJ - 1751 The island nation of Flatopia is perfectly flat. Unfortunately, Flatopia has a very poor system of public highways. The Flatopian government is aware of this problem an原创 2017-07-20 10:22:28 · 415 阅读 · 0 评论 -
Find The Multiple ——深搜POJ - 1426
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 200 and there原创 2017-07-20 09:56:22 · 231 阅读 · 0 评论 -
叠框
需要的时候,就把一个个大小差一圈的筐叠上去,使得从上往下看时,边筐花色交错。这个工作现在要让计算机来完成,得看你的了。Input输入是一个个的三元组,分别是,外筐尺寸n(n为满足0Output输出叠在一起的筐图案,中心花色与外筐花色字符从内层起交错相叠,多筐相叠时,最外筐的角总是被打磨掉。叠筐与叠筐之间应有一行间隔。Sample Input11 B A5 @ WSam转载 2017-05-03 21:52:22 · 603 阅读 · 0 评论
分享