
搜索
文章平均质量分 77
追逐星辰的光
脚踏实地,虚心前行
展开
-
棋盘问题 POJ - 1321
在一个给定形状的棋盘(形状可能是不规则的)上面摆放棋子,棋子没有区别。要求摆放时任意的两个棋子不能放在棋盘中的同一行或者同一列,请编程求解对于给定形状和大小的棋盘,摆放k个棋子的所有可行的摆放方案C。Input输入含有多组测试数据。 每组数据的第一行是两个正整数,n k,用一个空格隔开,表示了将在一个n*n的矩阵内描述棋盘,以及摆放棋子的数目。 n 当为-1 -1时表示输入结束原创 2017-12-30 19:07:55 · 179 阅读 · 0 评论 -
HDU 2181 哈密顿绕行世界问题
一个规则的实心十二面体,它的 20个顶点标出世界著名的20个城市,你从一个城市出发经过每个城市刚好一次后回到出发的城市。 Input前20行的第i行有3个数,表示与第i个城市相邻的3个城市.第20行以后每行有1个数m,m=1.m=0退出. Output输出从第m个城市出发经过每个城市1次又回到m的所有路线,如有多条路线,按字典序输出,每行1条路线.每行首先输出是第几条路线.然后个一个: 后列出经过原创 2018-01-02 14:42:31 · 584 阅读 · 0 评论 -
HDU 3533 Escape
The students of the HEU are maneuvering for their military training. The red army and the blue army are at war today. The blue army finds that Little A is the spy of the red army, so Little A has to原创 2018-01-03 11:35:21 · 261 阅读 · 0 评论 -
HDU 3085 Nightmare Ⅱ
参考大佬博客有所感悟:http://blog.youkuaiyun.com/yhyyxt/article/details/50603722Last night, little erriyue had a horrible nightmare. He dreamed that he and his girl friend were trapped in a big maze separately.转载 2018-01-03 16:44:06 · 292 阅读 · 0 评论 -
HDU 1067 Gap
Let's play a card game called Gap. You have 28 cards labeled with two-digit numbers. The first digit (from 1 to 4) represents the suit of the card, and the second digit (from 1 to 7) represents the原创 2018-01-04 15:38:43 · 391 阅读 · 0 评论 -
HDU 1728 逃离迷宫
给定一个m × n (m行, n列)的迷宫,迷宫中有两个位置,gloria想从迷宫的一个位置走到另外一个位置,当然迷宫中有些地方是空地,gloria可以穿越,有些地方是障碍,她必须绕行,从迷宫的一个位置,只能走到与它相邻的4个位置中,当然在行走过程中,gloria不能走到迷宫外面去。令人头痛的是,gloria是个没什么方向感的人,因此,她在行走过程中,不能转太多弯了,否则她会晕倒的。我们假定给定的原创 2018-01-04 19:06:31 · 1424 阅读 · 0 评论 -
CodeForces 520B Two Buttons
Vasya has found a strange device. On the front panel of a device there are: a red button, a blue button and a display showing some positive integer. After clicking the red button, device multiplies th原创 2018-01-04 19:29:06 · 298 阅读 · 0 评论 -
POJ 3187 Backward Digit Sums
FJ and his cows enjoy playing a mental game. They write down the numbers from 1 to N (1 <= N <= 10) in a certain order and then sum adjacent numbers to produce a new list with one fewer number. They r原创 2018-01-04 20:26:53 · 206 阅读 · 0 评论 -
HDU 1342 Lotto
In a Lotto I have ever played, one has to select 6 numbers from the set {1,2,...,49}. A popular strategy to play Lotto - although it doesn't increase your chance of winning - is to select a subset S c原创 2018-01-04 21:19:35 · 414 阅读 · 0 评论 -
HDU - 2354 Another Brick in the Wall
After years as a brick-layer, you've been called upon to analyze the structural integrity of various brick walls built by the Tetrad Corporation. Instead of using regular-sized bricks, the Tetrad Co原创 2017-12-30 12:23:35 · 411 阅读 · 0 评论 -
CodeForces 208B Solitaire
A boy named Vasya wants to play an old Russian solitaire called "Accordion". In this solitaire, the player must observe the following rules:A deck of n cards is carefully shuffled, then all n card原创 2018-01-05 18:03:19 · 348 阅读 · 0 评论 -
HDU 2102 A计划
可怜的公主在一次次被魔王掳走一次次被骑士们救回来之后,而今,不幸的她再一次面临生命的考验。魔王已经发出消息说将在T时刻吃掉公主,因为他听信谣言说吃公主的肉也能长生不老。年迈的国王正是心急如焚,告招天下勇士来拯救公主。不过公主早已习以为常,她深信智勇的骑士LJ肯定能将她救出。 现据密探所报,公主被关在一个两层的迷宫里,迷宫的入口是S(0,0,0),公主的位置用P表示,时空传输机用#表示,墙用*表原创 2018-01-02 11:36:21 · 233 阅读 · 0 评论 -
POJ 3984 迷宫问题
定义一个二维数组: int maze[5][5] = { 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 0,};它表示一个迷宫,其中的1表示墙壁,0表示可以走的路,只能横着走或竖着走,不能斜着走,要求编程序找出从左上角到右下角的最短路线。 Input 一个5原创 2018-01-01 23:36:11 · 269 阅读 · 0 评论 -
UVA 572 Oil Deposits
The GeoSurvComp geologic survey company is responsible for detecting underground oil deposits. GeoSurvComp works with one large rectangular region of land at a time, and creates a grid that divides th原创 2018-01-01 23:35:09 · 263 阅读 · 0 评论 -
Dungeon Master POJ - 2251
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 north, south原创 2017-12-30 20:58:46 · 172 阅读 · 0 评论 -
POJ 3278 Catch That Cow
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 (0 ≤ K ≤ 100,0原创 2017-12-30 23:56:28 · 202 阅读 · 0 评论 -
POJ 3279 Fliptile
Farmer John knows that an intellectually satisfied cow is a happy cow who will give more milk. He has arranged a brainy activity for cows in which they manipulate an M× N grid (1 ≤ M ≤ 15; 1 ≤ N ≤ 15)原创 2017-12-31 12:30:32 · 225 阅读 · 0 评论 -
1426 Find The Multiple
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-12-31 13:54:23 · 259 阅读 · 0 评论 -
POJ 3126 Prime Path
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 is a matter of s原创 2017-12-31 14:57:13 · 294 阅读 · 0 评论 -
POJ3414 - Pots
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(i) empty the po原创 2017-12-31 23:32:01 · 338 阅读 · 0 评论 -
FZU - 2150 Fire Game
Fat brother and Maze are playing a kind of special (hentai) game on an N*M board (N rows, M columns). At the beginning, each grid of this board is consisting of grass or just empty and then they start原创 2018-01-01 16:15:22 · 213 阅读 · 0 评论 -
uva 11624 FIRE!
Fire!Joe works in a maze. Unfortunately,portions of the maze have caught on fire, and the owner of the maze neglectedto create a fire escape plan. Help Joe escape the maze.Given Joe's locati原创 2018-01-01 17:53:44 · 188 阅读 · 0 评论 -
HDU 2612 Find a way
Pass a year learning in Hangzhou, yifenfei arrival hometown Ningbo at finally. Leave Ningbo one year, yifenfei have many people to meet. Especially a good friend Merceki. Yifenfei’s home is at the c原创 2017-12-26 19:45:11 · 187 阅读 · 0 评论 -
HDU 1495 非常可乐
大家一定觉的运动以后喝可乐是一件很惬意的事情,但是seeyou却不这么认为。因为每次当seeyou买了可乐以后,阿牛就要求和seeyou一起分享这一瓶可乐,而且一定要喝的和seeyou一样多。但seeyou的手中只有两个杯子,它们的容量分别是N 毫升和M 毫升 可乐的体积为S (SInput三个整数 : S 可乐的体积 , N 和 M是两个杯子的容量,以"0 0 0"结束。Output原创 2018-01-01 23:27:47 · 200 阅读 · 0 评论 -
POJ - 2386 Lake Counting
Due to recent rains, water has pooled in various places in Farmer John's field, which is represented by a rectangle of N x M (1 <= N <= 100; 1 <= M <= 100) squares. Each square contains either water (原创 2018-01-07 16:03:06 · 253 阅读 · 0 评论