自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(26)
  • 收藏
  • 关注

原创 不要62(数位DP)

Description杭州人称那些傻乎乎粘嗒嗒的人为62(音:laoer)。 杭州交通管理局经常会扩充一些的士车牌照,新近出来一个好消息,以后上牌照,不再含有不吉利的数字了,这样一来,就可以消除个别的士司机和乘客的心理障碍,更安全地服务大众。不吉利的数字为所有含有4或62的号码。例如: 62315 73418 88914 都属于不吉利号码。但是,61152虽然含有6和2

2015-01-30 14:37:31 321

原创 windy数(数位DP)

Descriptionwindy定义了一种windy数。不含前导零且相邻两个数字之差至少为2的正整数被称为windy数。 windy想知道,在A和B之间,包括A和B,总共有多少个windy数?Input包含两个整数,A B。Output一个整数。Sample Input【输入样例

2015-01-30 13:32:57 395

原创 Bribing FIPA(树形DP)

DescriptionThere is going to be a voting at FIPA (Fédération Internationale de Programmation Association) to determine the host of the next IPWC (International Programming World Cup). Benj

2015-01-29 18:41:24 418

原创 Round and Round We Go

DescriptionA cyclic number is an integer n digits in length which, when multiplied by any integer from 1 to n, yields a"cycle"of the digits of the original number. That is, if you consider the

2015-01-29 18:37:20 272

原创 A Simple Problem with Integers

DescriptionYou have N integers, A1,A2, ... , AN. You need to deal with two kinds of operations. One type of operation is to add some given number to each number in a given interval. Th

2015-01-29 17:04:53 273

原创 A计划

Description可怜的公主在一次次被魔王掳走一次次被骑士们救回来之后,而今,不幸的她再一次面临生命的考验。魔王已经发出消息说将在T时刻吃掉公主,因为他听信谣言说吃公主的肉也能长生不老。年迈的国王正是心急如焚,告招天下勇士来拯救公主。不过公主早已习以为常,她深信智勇的骑士LJ肯定能将她救出。现据密探所报,公主被关在一个两层的迷宫里,迷宫的入口是S(0,0,0),公主

2015-01-29 16:29:59 380

原创 Train Problem I

DescriptionAs the new term comes, the Ignatius Train Station is very busy nowadays. A lot of student want to get back to school by train(because the trains in the Ignatius Train Station is the fas

2015-01-29 16:24:58 280

原创 小希的迷宫

Description上次Gardon的迷宫城堡小希玩了很久(见Problem B),现在她也想设计一个迷宫让Gardon来走。但是她设计迷宫的思路不一样,首先她认为所有的通道都应该是双向连通的,就是说如果有一个通道连通了房间A和B,那么既可以通过它从房间A走到房间B,也可以通过它从房间B走到房间A,为了提高难度,小希希望任意两个房间有且仅有一条路径可以相通(除非走了回头路)。

2015-01-29 16:03:53 537 2

原创 More is better(并查集)

DescriptionMr Wang wants some boys to help him with a project. Because the project is rather complex,the more boys come, the better it will be. Of course there are certain requirements.

2015-01-29 14:51:15 260

原创 Rescue

Problem DescriptionAngel was caught by the MOLIGPY! He was put in prison by Moligpy. The prison is described as a N * M (N, M Angel's friends want to save Angel. Their task is: approach Ange

2015-01-28 14:43:39 306

原创 畅通工程NO.3

Description相信大家都听说一个“百岛湖”的地方吧,百岛湖的居民生活在不同的小岛中,当他们想去其他的小岛时都要通过划小船来实现。现在政府决定大力发展百岛湖,发展首先要解决的问题当然是交通问题,政府决定实现百岛湖的全畅通!经过考察小组RPRush对百岛湖的情况充分了解后,决定在符合条件的小岛间建上桥,所谓符合条件,就是2个小岛之间的距离不能小于10米,也不能大于1000米

2015-01-28 14:15:26 333

原创 A Game Between Alice and Bob

DescriptionAlice and Bob play the following game. A series of numbers is written on the blackboard. Alice and Bob take turns choosing one of the numbers, and replace it with one of its posit

2015-01-26 19:18:06 686

原创 整数划分

题目描述:整数划分是一个经典的问题,希望这道题对你的组合数学有所帮助. 提示 1. 将5划分成若干正整数之和的划分为: 5, 4+1, 3+2, 3+1+1, 2+2+1, 2+1+1+1, 1+1+1+1+1 2. 将5划分成2个正整数之和的划分为: 3+2, 4+1 3. 将5划分成最大数不超过2的划分为: 1+1+1+1+1, 1+1+1+2, 1+2+2 4.

2015-01-26 15:48:40 340

原创 Common Subsequence(最长公共子序列)

DescriptionA subsequence of a given sequence is the given sequence with some elements (possible none) left out. Given a sequence X = another sequence Z = is a subsequence of X if there exi

2015-01-25 12:01:06 291

原创 Brackets Sequence

DescriptionLet us define a regular brackets sequence in the following way:1. Empty sequence is a regular sequence. 2. If S is a regular sequence, then (S) and [S] are both regular se

2015-01-24 15:30:28 740

原创 To the Max

DescriptionGiven a two-dimensional array of positive and negative integers, a sub-rectangle is any contiguous sub-array of size 1*1 or greater located within the whole array. The sum of a re

2015-01-24 12:42:30 253

原创 Dungeon Master

DescriptionYou 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

2015-01-23 20:22:55 312

原创 推箱子

Description推箱子是一个很经典的游戏.今天我们来玩一个简单版本.在一个M*N的房间里有一个箱子和一个搬运工,搬运工的工作就是把箱子推到指定的位置,注意,搬运工只能推箱子而不能拉箱子,因此如果箱子被推到一个角上(如图2)那么箱子就不能再被移动了,如果箱子被推到一面墙上,那么箱子只能沿着墙移动.现在给定房间的结构,箱子的位置,搬运工的位置和箱子要被推去的位置,

2015-01-23 14:55:38 877

原创 数独

#include#include#include#include#include/* 构造完成标志 */int sign; //0代表false,1代表true/* 创建数独矩阵 */int num[9][9];/* 函数声明 */void Input();void Output();int Check(int n, int key);//返回0代表fals

2015-01-23 13:26:52 489

原创 Battle City

DescriptionMany of us had played the game "Battle city" in our childhood, and some people (like me) even often play it on computer now.What we are discussing is a simple edition of t

2015-01-22 11:00:18 360

原创 翻纸牌游戏

Problem Description有一种纸牌游戏,很有意思,给你N张纸牌,一字排开,纸牌有正反两面,开始的纸牌可能是一种乱的状态(有些朝正,有些朝反),现在你需要整理这些纸牌。但是麻烦的是,每当你翻一张纸牌(由正翻到反,或者有反翻到正)时,他左右两张纸牌(最左边和最右边的纸牌,只会影响附近一张)也必须跟着翻动,现在给你一个乱的状态,问你能否把他们整理好,使得每张纸牌都正面朝上,如果可以

2015-01-22 10:42:45 477

原创 Dearboy's Puzzle

DescriptionDearboy is a game lover. Recently, he loves playing the game Lian Lian Kan. This game is played on a board with N*M grids, and lots of cards are put on the board in the grids. You

2015-01-21 22:06:58 350

原创 The Game

DescriptionOne morning, you wake up and think: "I am such a good programmer. Why not make some money?'' So you decide to write a computer game.The game takes place on a rectangular board

2015-01-21 16:14:18 308

原创 Stealing Harry Potter's Precious

Description  Harry Potter has some precious. For example, his invisible robe, his wand and his owl. When Hogwarts school is in holiday, Harry Potter has to go back to uncle Vernon's home. Bu

2015-01-21 12:41:42 396

原创 Last non-zero Digit in N!

DescriptionThe expression N!, read as "N factorial," denotes the product of the first N positive integers, where N is nonnegative. So, for example,N N! 0 1 1 1 2 2 3 6 4 24 5

2015-01-21 10:35:51 244

原创 Square

DescriptionGiven a set of sticks of various lengths, is it possible to join them end-to-end to form a square?  InputThe first line of input contains N, the number of test c

2015-01-21 00:19:42 269

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除