- 博客(35)
- 收藏
- 关注
原创 L1-032 Left-pad (20 分)
L1-032 Left-pad (20 分)根据新浪微博上的消息,有一位开发者不满NPM(Node Package Manager)的做法,收回了自己的开源代码,其中包括一个叫left-pad的模块,就是这个模块把javascript里面的React/Babel干瘫痪了。这是个什么样的模块?就是在字符串前填充一些东西到一定的长度。例如用*去填充字符串GPLT,使之长度为10,调用left-pad的结果就应该是******GPLT。Node社区曾经对left-pad紧急发布了一个替代,被严重吐槽。下面就请
2021-03-14 21:55:46 149
原创 L1-011 A-B (20 分)
L1-011 A-B (20 分)本题要求你计算A−B。不过麻烦的是,A和B都是字符串 —— 即从字符串A中把字符串B所包含的字符全删掉,剩下的字符组成的就是字符串A−B。输入格式:输入在2行中先后给出字符串A和B。两字符串的长度都不超过104,并且保证每个字符串都是由可见的ASCII码和空白字符组成,最后以换行符结束。输出格式:在一行中打印出A−B的结果字符串。输入样例:I love GPLT! It's a fun game!aeiou输出样例:I lv
2021-03-14 20:56:28 123
原创 L1-023 输出GPLT (20 分)
L1-023 输出GPLT (20 分)给定一个长度不超过10000的、仅由英文字母构成的字符串。请将字符重新调整顺序,按GPLTGPLT....这样的顺序输出,并忽略其它字符。当然,四种字符(不区分大小写)的个数不一定是一样多的,若某种字符已经输出完,则余下的字符仍按GPLT的顺序打印,直到所有字符都被输出。输入格式:输入在一行中给出一个长度不超过10000的、仅由英文字母构成的非空字符串。输出格式:在一行中按题目要求输出排序后的字符串。题目保证输出非空。输入样例:pcTcl
2021-03-12 20:44:09 142
原创 L1-009 N个数求和
L1-009 N个数求和 (20 分)本题的要求很简单,就是求N个数字的和。麻烦的是,这些数字是以有理数分子/分母的形式给出的,你输出的和也必须是有理数的形式。输入格式:输入第一行给出一个正整数N(≤100)。随后一行按格式a1/b1 a2/b2 ...给出N个有理数。题目保证所有分子和分母都在长整型范围内。另外,负数的符号一定出现在分子前面。输出格式:输出上述数字和的最简形式 —— 即将结果写成整数部分 分数部分,其中分数部分写成分子/分母,要求分子小于分母,且它们没有公因子。如果结果
2021-03-12 20:17:12 137
原创 A. Case of the Zeros and Ones
A. Case of the Zeros and OnesAndrewid the Android is a galaxy-famous detective. In his free time he likes to think about strings containing zeros and ones.Once he thought about a string of length n consisting of zeroes and ones. Consider the following op
2020-08-06 12:35:01 149
原创 A. Cashier
A. CashierVasya has recently got a job as a cashier at a local store. His day at work is L minutes long. Vasya has already memorized n regular customers, the i-th of which comes after ti minutes after the beginning of the day, and his service consumes li
2020-08-03 19:25:32 126
原创 A. Laptops
A. LaptopsOne day Dima and Alex had an argument about the price and quality of laptops. Dima thinks that the more expensive a laptop is, the better it is. Alex disagrees. Alex thinks that there are two laptops, such that the price of the first laptop is l
2020-08-03 16:59:17 293
原创 A. Holidays
A. HolidaysOn the planet Mars a year lasts exactly n days (there are no leap years on Mars). But Martians have the same weeks as earthlings — 5 work days and then 2 days off. Your task is to determine the minimum possible and the maximum possible number o
2020-08-03 16:21:13 112
原创 A. Free Cash
A. Free CashValera runs a 24/7 fast food cafe. He magically learned that next day n people will visit his cafe. For each person we know the arrival time: the i-th person comes exactly at h i hours m i minutes. The cafe spends less than a minute to serve e
2020-08-03 10:09:33 210
原创 A. Minimal Square
A. Minimal SquareFind the minimum area of a square land on which you can place two identical rectangular a×b houses. The sides of the houses should be parallel to the sides of the desired square land.Formally,You are given two identical rectangles with
2020-08-02 15:56:09 160
原创 B. Interesting drink
B. Interesting drinkVasiliy likes to rest after a hard work, so you may often meet him in some bar nearby. As all programmers do, he loves the famous drink “Beecola”, which can be bought in n different shops in the city. It’s known that the price of one b
2020-08-02 13:06:30 166
原创 A. Boredom
A. BoredomAlex doesn’t like boredom. That’s why whenever he gets bored, he comes up with games. One long winter evening he came up with a game and decided to play it.Given a sequence a consisting of n integers. The player can make several steps. In a sin
2020-08-01 21:53:39 180
原创 C. Given Length and Sum of Digits...
#C. Given Length and Sum of Digits…You have a positive integer m and a non-negative integer s. Your task is to find the smallest and the largest of the numbers that have length m and sum of digits s. The required numbers should be non-negative integers wr
2020-08-01 16:52:45 128
原创 1352A - Sum of Round Numbers
#1352A - Sum of Round NumbersA positive (strictly greater than zero) integer is called round if it is of the form d00…0. In other words, a positive integer is round if all its digits except the leftmost (most significant) are equal to zero. In particular,
2020-08-01 15:45:52 123
原创 A. Candies and Two Sisters
#A. Candies and Two SistersThere are two sisters Alice and Betty. You have n candies. You want to distribute these n candies between two sisters in such a way that:Alice will get a (a>0) candies;Betty will get b (b>0) candies;each sister will get
2020-08-01 11:04:04 240
原创 A. Divisibility Problem
#A. Divisibility ProblemYou are given two positive integers a and b. In one move you can increase a by 1 (replace a with a+1). Your task is to find the minimum number of moves you need to do in order to make a divisible by b. It is possible, that you have
2020-08-01 10:45:00 233
原创 9A - Die Roll
A. Die Rolltime limit per test1 secondmemory limit per test64 megabytesinputstandard inputoutputstandard outputYakko, Wakko and Dot, world-famous animaniacs, decided to rest from acting in cartoo...
2019-05-22 20:41:08 422
原创 363B - Fence//比较连续木板的长度
B. Fencetime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputThere is a fence in front of Polycarpus’s home. The fence consists of n planks of the ...
2019-05-22 15:26:53 143
原创 1091A - New Year and the Christmas Ornament
A. New Year and the Christmas Ornamenttime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputAlice and Bob are decorating a Christmas Tree.Alice wan...
2019-05-19 19:26:56 316
原创 621A - Wet Shark and Odd and Even
A. Wet Shark and Odd and Eventime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputToday, Wet Shark is given n integers. Using any of these integer...
2019-05-19 18:43:17 127
原创 567A - Lineland Mail
A. Lineland Mailtime limit per test3 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputAll cities of Lineland are located on the Ox coordinate axis. Thus, each city...
2019-05-19 17:56:19 751
原创 349A - Cinema Line
A. Cinema Linetime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputThe new “Die Hard” movie has just been released! There are n people at the cine...
2019-05-19 17:07:07 147
原创 474A - Keyboard
A. Keyboardtimelimit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputOur good friend Mole is trying to code a big message. He is typing on an unusual ke...
2019-05-10 20:00:47 274
原创 1108B - Divisors of Two Integers
B. Divisors of Two Integerstime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputRecently you have received two positive integer numbers x and y. Y...
2019-05-10 19:32:52 274
原创 732B - Cormen --- The Best Friend Of a Man
B. Cormen — The Best Friend Of a Mantime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputRecently a dog was bought for Polycarp. The dog’s name is ...
2019-05-10 08:59:41 125
原创 651A - Joysticks
A. Joystickstimelimit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputFriends are going to play console. They have two joysticks and only one charger for...
2019-05-10 08:26:26 128
原创 B. T-primes
B. T-primestime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputWe know that prime numbers are positive integers that have exactly two distinct po...
2019-05-09 16:50:32 601
原创 469A - I Wanna Be the Guy
A. I Wanna Be the Guytime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputThere is a game called “I Wanna Be the Guy”, consisting of n levels. Litt...
2019-05-09 16:17:41 537
原创 A. Puzzles
A. Puzzlestime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputThe end of the school year is near and Ms. Manana, the teacher, will soon have to sa...
2019-05-08 22:21:26 216
原创 B. BerSU Ball
B. BerSU Balltime limit per test1 secondmemory limit per test256 megabytesinputs tandard inputoutput standard outputThe Berland State University is hosting a ballroom dance in celebration of its ...
2019-05-08 21:00:31 224
原创 A. Police Recruits
A. Police Recruitstime limit per test1 secondmemory limit per test256 megabytesinput standard inputoutput standard outputThe police department of your city has just started its journey. Initially...
2019-05-08 19:55:38 167
原创 A. Team Olympiad
The School №0 of the capital of Berland has n children studying in it. All the children in this school are gifted: some of them are good at programming, some are good at maths, others are good at PE (...
2019-04-29 09:06:51 244
原创 A. New Year Transportation
A. New Year Transportationtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputNew Year is coming in Line World! In this world, there are n cells ...
2019-04-28 22:58:37 161
原创 A. Multiplication
A. MultiplicationTabletime limit per test1 secondmemory limit per test256 megabytesinput standard inputoutput standard outputLet’s consider a table consisting of n rows and n columns. The cell lo...
2019-04-28 22:48:11 220
原创 B. Vanya and Lanterns
##B. Vanya and Lanternstime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputVanya walks late at night along a straight street of length l, lit by n...
2019-04-28 17:00:26 162
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人