
ACM基础
BZUzbx
这个作者很懒,什么都没留下…
展开
-
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 · 478 阅读 · 0 评论 -
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 · 372 阅读 · 0 评论 -
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 · 258 阅读 · 0 评论 -
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 · 189 阅读 · 0 评论 -
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 · 717 阅读 · 0 评论 -
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 · 379 阅读 · 0 评论 -
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 · 152 阅读 · 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 · 144 阅读 · 0 评论 -
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 · 179 阅读 · 0 评论 -
F - Heist
昨天滨院acm集训队遭到了很严重的盗窃,万恶的小偷将同学们梦寐以求的签到题偷走了。在失窃后,命题组手中还有n道签到题,编号分别为a1, a2, … an。现在命题组要统计有多少道试题失窃从而重新给同学们制作可爱的签到题。已知签到题从小到大编号,并且编号是连号的。换句话说,如果有两道签到题编号分别为4,9,则4-9内所有数字均为签到题编号。现在,由于命题人很懒,想要出尽可能少的题目,所以要求给出最少...原创 2019-11-24 20:12:53 · 184 阅读 · 0 评论 -
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 · 241 阅读 · 0 评论 -
D - Oil Deposits
D - Oil Deposits背景描述滨州地质检察局 的 小斌 同志负责探测bzu地下石油储藏。 小斌现在在一块矩形区域探测石油。他们通过专业设备,来分析每个小块中是否蕴藏石油。如果这些蕴藏石油的小方格相邻(横向相邻,纵向相邻,还有对角相邻),那么他们被认为是同一油藏的一部分。在这块矩形区域,可能有很多油藏。你的任务是确定有多少不同的油藏。输入输入可能有多个矩形区域(即可能有多组测试)。...原创 2019-11-24 20:08:04 · 272 阅读 · 0 评论 -
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 · 269 阅读 · 0 评论 -
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 · 128 阅读 · 0 评论 -
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 · 413 阅读 · 0 评论