自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 Another Sith Tournament

链接:http://acm.hust.edu.cn/vjudge/problem/401746/origin题目:The rules of Sith Tournament are well known to everyone. n Sith take part in the Tournament. The Tournament starts with the random

2016-09-04 17:20:22 280

原创 Iterated Linear Function

链接:http://acm.hust.edu.cn/vjudge/problem/401745/origin题目:Consider a linear function f(x) = Ax + B. Let's defineg(0)(x) = x andg(n)(x) = f(g(n - 1)(x)) forn > 0. For the given integer values

2016-09-04 17:09:12 376

原创 Joty and Chocolate

链接:http://acm.hust.edu.cn/vjudge/problem/401744/origin题目:Little Joty has got a task to do. She has a line of n tiles indexed from1 to n. She has to paint them in a strange pattern.An unp

2016-09-04 16:59:41 396

原创 The Same Calendar

链接:http://acm.hust.edu.cn/vjudge/problem/401743/origin题目:The girl Taylor has a beautiful calendar for the year y. In the calendar all days are given with their days of week: Monday, Tuesday,

2016-09-04 16:54:53 389

原创 Johny Likes Numbers

链接:http://acm.hust.edu.cn/vjudge/problem/401740/origin题目:Johny likes numbers n and k very much. Now Johny wants to find the smallest integer x greater than n, so it is divisible by the number

2016-09-04 16:49:17 256

原创 Jam's balance

链接:题目:Jim has a balance and N weights. $(1 \leq N \leq 20)$ The balance can only tell whether things on different side are the same weight. Weights can be put on left side or right side arbitr

2016-09-04 16:25:45 396

原创 Safecracker

链接:http://acm.hust.edu.cn/vjudge/problem/18952/origin题目:=== Op tech briefing, 2002/11/02 06:42 CST === "The item is locked in a Klein safe behind a painting in the second-floor library. Klein sa

2016-09-04 16:16:35 155

原创 又见GCD

链接:http://acm.hust.edu.cn/vjudge/problem/25715/origin题目:有三个正整数a,b,c(0题意:。分析:数据不是很大,其实可以从2*b开始枚举,用gcd(辗转相除)的快捷方法验证的(图转,侵删。。)我用了比较笨的方法:把a和b分解质因数,再从a中把b的质因数剔除出去,然后开始从小枚举选择c除去b的质因数(只要不出现

2016-09-04 15:55:45 480

原创 棋盘问题

链接:http://acm.hust.edu.cn/vjudge/problem/15202/origin题目:在一个给定形状的棋盘(形状可能是不规则的)上面摆放棋子,棋子没有区别。要求摆放时任意的两个棋子不能放在棋盘中的同一行或者同一列,请编程求解对于给定形状和大小的棋盘,摆放k个棋子的所有可行的摆放方案C。题意:。分析:这是一道类似八皇后的dfs题,

2016-09-04 15:47:24 181

原创 Sticks

链接:http://acm.hust.edu.cn/vjudge/problem/14913/origin题目:George took sticks of the same length and cut them randomly until all parts became at most 50 units long. Now he wants to return sticks to t

2016-09-04 15:38:57 594

原创 迷宫问题

链接:http://acm.hust.edu.cn/vjudge/problem/19699/origin题目:定义一个二维数组: 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表示墙壁,

2016-09-04 15:22:06 441

原创 N皇后问题

链接:http://acm.hust.edu.cn/vjudge/problem/33634/origin题目:在N*N的方格棋盘放置了N个皇后,使得它们不相互攻击(即任意2个皇后不允许处在同一排,同一列,也不允许处在与棋盘边框成45角的斜线上。 你的任务是,对于给定的N,求出有多少种合法的放置方法。题意:..分析:首先这是一道经典的dfs,或者回溯递归题,当年在数据结

2016-09-04 15:11:35 240

原创 Connecting Universities

链接:http://acm.hust.edu.cn/vjudge/problem/427647/origin题目:Treeland is a country in which there are n towns connected byn - 1 two-way road such that it's possible to get from any town to any

2016-09-03 21:45:56 254

原创 As Fast As Possible

链接:http://acm.hust.edu.cn/vjudge/problem/427646/origin题目:On vacations n pupils decided to go on excursion and gather all together. They need to overcome the path with the lengthl meters. E

2016-09-03 21:42:22 387

原创 They Are Everywhere

链接:http://acm.hust.edu.cn/vjudge/problem/427892/origin题目:Sergei B., the young coach of Pokemons, has found the big house which consists ofn flats ordered in a row from left to right. It is

2016-09-03 21:35:22 257

原创 Cells Not Under Attackvct

链接:http://acm.hust.edu.cn/vjudge/problem/427645/origin题目:Vasya has the square chessboard of size n × n andm rooks. Initially the chessboard is empty. Vasya will consequently put the rooks

2016-09-03 21:23:52 203

原创 Vasiliy's Multiset

链接:http://acm.hust.edu.cn/vjudge/problem/460314/origin题目:Author has gone out of the stories about Vasiliy, so here is just a formal task description.You are given q queries and a multiset

2016-09-03 17:51:49 320

原创 Another Meaning

链接:http://acm.hust.edu.cn/vjudge/problem/435534/origin题目:As is known to all, in many cases, a word has two meanings. Such as “hehe”, which not only means “hehe”, but also means “excuse me”.T

2016-09-03 17:39:31 304

原创 Hat’s Words

链接:http://acm.hust.edu.cn/vjudge/problem/18360/origin题目:A hat’s word is a word in the dictionary that is the concatenation of exactly two other words in the dictionary.You are to find all the

2016-09-03 17:31:56 174

原创 Shortest Prefixes

链接:http://acm.hust.edu.cn/vjudge/problem/11157/origin题目:A prefix of a string is a substring starting at the beginning of the given string. The prefixes of "carbon" are: "c", "ca", "car", "carb", "

2016-09-03 17:30:23 202

原创 Seek the Name, Seek the Fame

链接:http://acm.hust.edu.cn/vjudge/problem/10055/origin题目:The little cat is so famous, that many couples tramp over hill and dale to Byteland, and asked the little cat to give names to their newly-b

2016-09-03 17:08:41 149

原创 Crazy Search

链接:http://acm.hust.edu.cn/vjudge/problem/17714/origin题目:Many people like to solve hard puzzles some of which may lead them to madness. One such puzzle could be finding a hidden prime number in a g

2016-09-03 17:06:26 252

原创 Oulipo

链接:http://acm.hust.edu.cn/vjudge/problem/10368/origin题目:The French author Georges Perec (1936–1982) once wrote a book, La disparition, without the letter'e'. He was a member of the Oulipo

2016-09-03 16:49:17 174

原创 Happy 2004

链接:http://acm.hust.edu.cn/vjudge/problem/40652/origin题目:Consider a positive integer X,and let S be the sum of all positive integer divisors of 2004^X. Your job is to determine S modulo 29 (the res

2016-08-31 21:36:01 278

原创 abs

链接:http://acm.hust.edu.cn/vjudge/problem/440426/origin题目:Given a number x, ask positive integer  , that satisfy the following conditions: 1. The absolute value of y - x is minimal 2. To prim

2016-08-31 21:29:54 195

原创 Looooops

链接:http://acm.hust.edu.cn/vjudge/problem/21464/origin题目:A Compiler Mystery: We are given a C-language style for loop of type for (variable = A; variable != B; variable += C) statement;I.e

2016-08-31 21:24:36 242

原创 青蛙的约会

链接:http://acm.hust.edu.cn/vjudge/problem/10755/origin题目:两只青蛙在网上相识了,它们聊得很开心,于是觉得很有必要见一面。它们很高兴地发现它们住在同一条纬度线上,于是它们约定各自朝西跳,直到碰面为止。可是它们出发之前忘记了一件很重要的事情,既没有问清楚对方的特征,也没有约定见面的具体位置。不过青蛙们都是很乐观的,它们觉得只要一直朝着某个方

2016-08-31 21:17:36 153

原创 Find a multiple

链接:http://acm.hust.edu.cn/vjudge/problem/17962/origin题目:The input contains N natural (i.e. positive integer) numbers ( N <= 10000 ). Each of that numbers is not greater than 15000. This numbers ar

2016-08-31 21:12:43 177

原创 Prime Land

链接:http://acm.hust.edu.cn/vjudge/problem/21459/origin题目:Everybody in the Prime Land is using a prime base number system. In this system, each positive integer x is represented as follows: Let {pi}

2016-08-31 20:41:17 295

原创 Digit Primes

链接:http://acm.hust.edu.cn/vjudge/problem/25171/origin题目:A prime number is a positive number, which is divisible by exactly two different integers. A digit primeis a prime number whose sum

2016-08-31 20:25:25 425

原创 人见人爱A^B

链接:http://acm.hust.edu.cn/vjudge/problem/17489/origin题目:求A^B的最后三位数表示的整数。 说明:A^B的含义是“A的B次方”题意:。分析:这是数论里面的模运算定理,模运算在加减乘三运算中满足分配律,可以任意分配,注意除法不可以用分配律,在遇到除法时要用群概念中的逆元来变成乘法。此外i,本体要用快速幂来优化。

2016-08-31 20:17:49 149

原创 整除的尾数

链接:http://acm.hust.edu.cn/vjudge/problem/23629/origin题目:一个整数,只知道前几位,不知道末二位,被另一个整数除尽了,那么该数的末二位该是什么呢?题意:。。分析:数论里面简单的水题一般就是暴力了。这道题主要坑在了有只有个位的情况,需要变成两位输出。题解:#include #include #include #

2016-08-31 20:11:54 269

原创 七夕节

链接:http://acm.hust.edu.cn/vjudge/problem/22310/origin题目:七夕节那天,月老来到数字王国,他在城门上贴了一张告示,并且和数字王国的人们说:"你们想知道你们的另一半是谁吗?那就按照告示上的方法去找吧!" 人们纷纷来到告示前,都想知道谁才是自己的另一半.告示如下: 数字N的因子就是所有比N小又能被N整除的所有正整数

2016-08-31 20:05:19 176

原创 Nearest Common Ancestors

链接:http://poj.org/problem?id=1330题目:A rooted tree is a well-known data structure in computer science and engineering. An example is shown below:In the figure, each node is labeled with a

2016-08-30 21:34:42 351

原创 Frequent values

链接:http://poj.org/problem?id=3368题目:You are given a sequence of n integers a1 , a2 , ... , an in non-decreasing order. In addition to that, you are given several queries consisting of indicesi a

2016-08-30 20:09:37 231

原创 Matrix

链接:http://poj.org/problem?id=2155题目:Given an N*N matrix A, whose elements are either 0 or 1. A[i, j] means the number in the i-th row and j-th column. Initially we have A[i, j] = 0 (1 <= i, j <= N

2016-08-30 14:50:55 430

原创 Ultra-QuickSort

链接:http://poj.org/problem?id=2299题目:In this problem, you have to analyze a particular sorting algorithm. The algorithm processes a sequence of n distinct integers by swapping two adjacent sequence

2016-08-30 13:55:31 216

原创 Stars

链接:http://poj.org/problem?id=2352题目:Astronomers often examine star maps where stars are represented by points on a plane and each star has Cartesian coordinates. Let the level of a star be an amou

2016-08-30 13:43:26 208

原创 Japan

链接:http://poj.org/problem?id=3067题目:Japan plans to welcome the ACM ICPC World Finals and a lot of roads must be built for the venue. Japan is tall island with N cities on the East coast and M citi

2016-08-30 13:24:27 867

原创 NanoApe Loves Sequence Ⅱ

链接:http://acm.split.hdu.edu.cn/showproblem.php?pid=5806题目:NanoApe, the Retired Dog, has returned back to prepare for for the National Higher Education Entrance Examination!In math class, Nan

2016-08-30 10:13:45 410

空空如也

空空如也

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

TA关注的人

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