自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 K - Find The Multiple

K - Find The MultipleGiven 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 grea...

2019-11-24 21:08:58 129

原创 J - A Knight's Journey

J - A Knight’s JourneyBackgroundThe knight is getting bored of seeing the same black and white squares again and again and has decided to make a journeyaround the world. Whenever a knight moves, it...

2019-11-24 21:07:55 144

原创 H - 哈密顿绕行世界问题

H - 哈密顿绕行世界问题一个规则的实心十二面体,它的 20个顶点标出世界著名的20个城市,你从一个城市出发经过每个城市刚好一次后回到出发的城市。Input前20行的第i行有3个数,表示与第i个城市相邻的3个城市.第20行以后每行有1个数m,m<=20,m>=1.m=0退出.Output输出从第m个城市出发经过每个城市1次又回到m的所有路线,如有多条路线,按字典序输出,每行1...

2019-11-24 21:06:40 111

原创 G - 迷宫问题

G - 迷宫问题定义一个二维数组: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 × 5的二维数组,表...

2019-11-24 21:04:47 1308

原创 F - Catch That Cow

F - Catch That CowFarmer 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 poi...

2019-11-24 21:03:39 199

原创 E - Curling 2.0

E - Curling 2.0On Planet MM-21, after their Olympic games this year, curling is getting popular. But the rules are somewhat different from ours. The game is played on an ice game board on which a squ...

2019-11-24 21:02:01 141

原创 D - 棋盘问题

D - 棋盘问题在一个给定形状的棋盘(形状可能是不规则的)上面摆放棋子,棋子没有区别。要求摆放时任意的两个棋子不能放在棋盘中的同一行或者同一列,请编程求解对于给定形状和大小的棋盘,摆放k个棋子的所有可行的摆放方案C。Input输入含有多组测试数据。每组数据的第一行是两个正整数,n k,用一个空格隔开,表示了将在一个n*n的矩阵内描述棋盘,以及摆放棋子的数目。 n <= 8 , k &...

2019-11-24 20:59:05 141

原创 C - 马走日

C - 马走日马在中国象棋以日字形规则移动。请编写一段程序,给定n*m大小的棋盘,以及马的初始位置(x,y),要求不能重复经过棋盘上的同一个点,计算马可以有多少途径遍历棋盘上的所有点。Input第一行为整数T(T < 10),表示测试数据组数。每一组测试数据包含一行,为四个整数,分别为棋盘的大小以及初始位置坐标n,m,x,y。(0<=x<=n-1,0<=y<...

2019-11-24 20:57:55 455 1

原创 B - 踩方格

B - 踩方格有一个方格矩阵,矩阵边界在无穷远处。我们做如下假设:a. 每走一步时,只能从当前方格移动一格,走到某个相邻的方格上;b. 走过的格子立即塌陷无法再走第二次;c. 只能向北、东、西三个方向走;请问:如果允许在方格矩阵上走n步,共有多少种不同的方案。2种走法只要有一步不一样,即被认为是不同的方案。Input允许在方格上行走的步数n(n <= 20)...

2019-11-24 20:56:56 152

原创 A - Oil Deposits

A - Oil DepositsThe 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 gri...

2019-11-24 20:54:26 203

原创 E - Cakes and Donuts

E - Cakes and DonutsLa Confiserie d’ABC sells cakes at 4 dollars each and doughnuts at 7 dollars each. Determine if there is a way to buy some of them for exactly N dollars. You can buy two or more d...

2019-11-24 20:50:40 400

原创 D - AtCoder Crackers

D - AtCoder CrackersTakahashi has decided to distribute N AtCoder Crackers to K users of as evenly as possible. When all the crackers are distributed, find the minimum possible (absolute) difference ...

2019-11-24 20:49:35 316

原创 B - Grid Compression

B - Grid CompressionThere is a grid of squares with H horizontal rows and W vertical columns. The square at the i-th row from the top and the j-th column from the left is represented as (i,j). Each s...

2019-11-24 20:48:13 212

原创 A - Train

A - TrainThere is an N-car train.You are given an integer i. Find the value of j such that the following statement is true: “the i-th car from the front of the train is the j-th car from the back.”...

2019-11-24 20:46:52 155

原创 B - div1&&div2

B - div1&&div2Theatre Square in the capital city of Berland has a rectangular shape with the size n × m meters. On the occasion of the city’s anniversary, a decision was taken to pave the Squ...

2019-11-24 20:42:39 664

原创 A - div1&&div2

“OK, you are not too bad, em… But you can never pass the next test.” feng5166 says.“I will tell you an odd number N, and then N integers. There will be a special integer among them, you have to tell ...

2019-11-24 20:41:08 334

原创 F - If We Were a Child Again

F - If We Were a Child Again代码:import java.math.BigInteger;import java.util.Scanner;public class Main { public static void main(String args[]) { BigInteger a,b; Scanner cin=new Scanner(Syste...

2019-11-24 20:25:18 115 1

原创 E - Theatre Square

E - Theatre Square一个城市的广场面积有 N×M平方米,过段时间,恰逢这个城市的庆典活动,主办方决定在广场上铺设一种新的地砖,这种地砖每块都是a×a平方米的。那么问题来了,最少需要多少地砖才能铺满整个广场呢?地砖一定要把广场铺满,允许地砖面积可以超过广场,同时,铺地砖的时候地砖的边必须和广场的边是平行的。Input输入数据包含三个正整数n,m,a(1 ≤  n, m, a ...

2019-11-24 20:23:04 117

原创 A - The Doors

A - The DoorsThree years have passes and nothing changed. It is still raining in London, and Mr. Black has to close all the doors in his home in order to not be flooded. Once, however, Mr. Black beca...

2019-11-24 20:19:34 148

原创 F - Heist

昨天滨院acm集训队遭到了很严重的盗窃,万恶的小偷将同学们梦寐以求的签到题偷走了。在失窃后,命题组手中还有n道签到题,编号分别为a1, a2, … an。现在命题组要统计有多少道试题失窃从而重新给同学们制作可爱的签到题。已知签到题从小到大编号,并且编号是连号的。换句话说,如果有两道签到题编号分别为4,9,则4-9内所有数字均为签到题编号。现在,由于命题人很懒,想要出尽可能少的题目,所以要求给出最少...

2019-11-24 20:12:53 156

原创 E - 又见GCD

E - 又见GCDBZU春季选拔赛过程中,由于选拔要求,每次比赛得有个数论的题,考虑到大家刚入门,出了个相对来说简单点的题。现给你两数字a和b,如果a和c的最大公约数是b且c不等于b,那么要求满足条件的最小的c,但是D学长觉得这个问题太简单了,决定拿出来考一考新加入集训队的同学们。那么,你能解决这个问题吗?Input第一行输入一个n,表示有n组测试数据,接下来的n行,每行输入两个正整数a,b...

2019-11-24 20:10:11 214

原创 D - Oil Deposits

D - Oil Deposits背景描述滨州地质检察局 的 小斌 同志负责探测bzu地下石油储藏。 小斌现在在一块矩形区域探测石油。他们通过专业设备,来分析每个小块中是否蕴藏石油。如果这些蕴藏石油的小方格相邻(横向相邻,纵向相邻,还有对角相邻),那么他们被认为是同一油藏的一部分。在这块矩形区域,可能有很多油藏。你的任务是确定有多少不同的油藏。输入输入可能有多个矩形区域(即可能有多组测试)。...

2019-11-24 20:08:04 254

原创 C - Let the Balloon Rise

C - Let the Balloon Rise题目描述有多种颜色的气球,统计它们的个数,并找出数量最多的那种颜色。Input有多组样例输入。每组样例第一行输入一个整数N (0 < N <= 1000) – 代表一共有N个气球。接下来N行每行输入一个不多于15个字母的字符串代表颜色。N=0代表输入结束。Output每组样例数据输出数量最多的那种颜色的气球。(保证输出唯一)...

2019-11-24 20:05:30 231

原创 B - {A} + {B}

B - {A} + {B}给你两个集合,要求{A} + {B}.注:同一个集合中不会有两个相同的元素.Input每组输入数据分为三行,第一行有两个数字n,m(0<n,m<=10000),分别表示集合A和集合B的元素个数.后两行分别表示集合A和集合B.每个元素为不超出int范围的整数,每个元素之间有一个空格隔开.Output针对每组数据输出一行数据,表示合并后的集合,要求从小...

2019-11-24 20:02:44 104

原创 A - 大菲波数

A - 大菲波数Fibonacci数列,定义如下:f(1)=f(2)=1f(n)=f(n-1)+f(n-2) n>=3。计算第n项Fibonacci数值。Input输入第一行为一个整数N,接下来N行为整数Pi(1<=Pi<=1000)。Output输出为N行,每行为对应的f(Pi)。Sample Input512345Sample Output1...

2019-11-24 19:59:02 378

空空如也

空空如也

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

TA关注的人

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