- 博客(49)
- 收藏
- 关注
原创 有 4 名同学到一家公司参加三个阶段的面试
有 4 名同学到一家公司参加三个阶段的面试,公司要求每个同学都必须首先找公司秘书初 试,然后到部门主管处复试,最后到经理处参加面试,并且不允许插队(前在任何一个阶段 4 名同学的顺序是一样的),由于 4 名同学的专业背景不同,所以每人在三个阶段的而试时 间也不同,如下表所示 (单位:min):秘书初试主管复试经理面试同学甲131520同学乙102018...
2020-04-28 21:36:26 8156 4
原创 Multiple Testcases
So you decided to hold a contest on Codeforces. You prepared the problems: statements, solutions, checkers, validators, tests… Suddenly, your coordinator asks you to change all your tests to multiple ...
2020-04-27 11:36:08 404
原创 Yet Another Counting Problem
You are given two integers a and b, and q queries. The i-th query consists of two numbers li and ri, and the answer to it is the number of integers x such that li≤x≤ri, and ((xmoda)modb)≠((xmodb)moda)...
2020-04-27 10:01:57 229
原创 Weights Distributing
You are given an undirected unweighted graph consisting of n vertices and m edges (which represents the map of Bertown) and the array of prices p of length m. It is guaranteed that there is a path bet...
2020-04-23 21:31:50 230
原创 Constant Palindrome Sum
You are given an array a consisting of n integers (it is guaranteed that n is even, i.e. divisible by 2). All ai does not exceed some integer k.Your task is to replace the minimum number of elements ...
2020-04-22 01:40:31 306 1
原创 Cow and Fields
Bessie is out grazing on the farm, which consists of n fields connected by m bidirectional roads. She is currently at field 1, and will return to her home at field n at the end of the day.The Cowfede...
2020-04-21 21:27:06 237
原创 Animal Observation (hard version)
The only difference between easy and hard versions is the constraint on k.Gildong loves observing animals, so he bought two cameras to take videos of wild animals in a forest. The color of one camera...
2020-04-21 00:02:05 293
原创 1-Trees and Queries
Gildong was hiking a mountain, walking by millions of trees. Inspired by them, he suddenly came up with an interesting idea for trees in data structures: What if we add another edge in a tree?Then he...
2020-04-20 16:57:45 208
原创 Shortest and Longest LIS
Gildong recently learned how to find the longest increasing subsequence (LIS) in O(nlogn) time for a sequence of length n. He wants to test himself if he can implement it correctly, but he couldn’t fi...
2020-04-20 16:05:38 144
原创 Air Conditioner
Gildong owns a bulgogi restaurant. The restaurant has a lot of customers, so many of them like to make a reservation before visiting it.Gildong tries so hard to satisfy the customers that he even mem...
2020-04-20 01:32:23 354
原创 Bobby's Bet
Bobby and Betty have a bet. Betty bets Bobby that he cannot roll an S-sided die (having values 1 through S) and obtain a value ≥R on at least X out of Y rolls. Betty has a variety of dice with differe...
2020-04-19 23:25:45 345
原创 Cantina of Babel
Characters in Star Wars each speak a language, but they typically understand a lot more languages that they don’t or can’t speak. For example, Han Solo might speak in Galactic Basic and Chewbacca migh...
2020-04-19 23:21:24 355
原创 Prefix-Suffix Palindrome (Hard version)
This is the hard version of the problem. The difference is the constraint on the sum of lengths of strings and the number of test cases. You can make hacks only if you solve all versions of this task....
2020-04-18 23:04:39 279
原创 Minimum Euler Cycle
You are given a complete directed graph Kn with n vertices: each pair of vertices u≠v in Kn have both directed edges (u,v) and (v,u); there are no self-loops.You should find such a cycle in Kn that v...
2020-04-17 23:20:32 231
原创 Circle of Monsters
You are playing another computer game, and now you have to slay n monsters. These monsters are standing in a circle, numbered clockwise from 1 to n. Initially, the i-th monster has ai health.You may ...
2020-04-17 20:17:59 235
原创 Kaavi and Magic Spell
Kaavi, the mysterious fortune teller, deeply believes that one’s fate is inevitable and unavoidable. Of course, she makes her living by predicting others’ future. While doing divination, Kaavi believe...
2020-04-17 15:09:08 373
原创 Xenia and Colorful Gems
Xenia is a girl being born a noble. Due to the inflexibility and harshness of her family, Xenia has to find some ways to amuse herself.Recently Xenia has bought nr red gems, ng green gems and nb blu...
2020-04-17 01:40:11 357
原创 Criss-Cross Cables
As a participant in the BAPC (Bizarrely Awful Parties Competition) you are preparing for your next show. Now, you do not know anything about music, so you rip off someone else’s playlist and decide no...
2020-04-17 00:13:38 239
原创 Daily Division
Oostende Beach is a very long beach located in the north of Belgium. On this beach, there are n huts located along a straight line. People can rent a room in one of those huts to spend their beach vac...
2020-04-16 21:35:12 237
原创 Eating Everything Efficiently
Margriet A. is in pizza heaven! She has bought a oneday access pass to Pizza World. Pizza World is a food festival, where all stands have their own special type of pizza. Margriet would really like to...
2020-04-16 14:35:10 186
原创 Linova and Kingdom
Writing light novels is the most important thing in Linova’s life. Last night, Linova dreamed about a fantastic kingdom. She began to write a light novel for the kingdom as soon as she woke up, and of...
2020-04-16 09:32:31 293
原创 Isomorphic Inversion
Let s be a given string of up to 10^6 digits. Find the maximal k for which it is possible to partition s into k consecutive contiguous substrings, such that the k parts form a palindrome. More precise...
2020-04-16 01:51:10 192
原创 Green Light
Sarah is cycling to work. On her way there, she encounters the same traffic light every day. Before she reaches the lights, she alternates between using social media on her mobile device and glancing ...
2020-04-16 01:43:11 134
原创 Edge Weight Assignment
You have unweighted tree of n vertices. You have to assign a positive weight to each edge so that the following condition would hold:For every two different leaves v1 and v2 of this tree, bitwise XOR...
2020-04-13 22:24:51 368
原创 Make k Equal
You are given the array a consisting of n elements and the integer k≤n.You want to obtain at least k equal elements in the array a. In one move, you can make one of the following two operations:Take...
2020-04-11 11:33:09 241
原创 Tree Queries
You are given a rooted tree consisting of n vertices numbered from 1 to n. The root of the tree is a vertex number 1.A tree is a connected undirected graph with n−1 edges.You are given m queries. Th...
2020-04-11 01:42:39 327
原创 Carousel
The round carousel consists of n figures of animals. Figures are numbered from 1 to n in order of the carousel moving. Thus, after the n-th figure the figure with the number 1 follows. Each figure has...
2020-04-11 00:09:42 159
原创 B. K-th Beautiful String
For the given integer n (n>2) let’s write down all the strings of length n which contain n−2 letters ‘a’ and two letters ‘b’ in lexicographical (alphabetical) order.Recall that the string s of len...
2020-04-10 20:19:37 154
原创 Improve SPAM
After the amazing job you did cleaning up duplicate users from the client database, your boss is eager to be impressed by your improvements to the company SPAM (System for PublishingAmazing Marketing)...
2020-04-09 23:41:48 267
原创 Fabricating Sculptures
Miguel Angelo is a great sculptor, widely recognized for his outdoor sculptures. In his hometown, it is very common to find one of his creations in squares and gardens. People love his sculptures, not...
2020-04-09 22:29:16 324
原创 Challenges in school №41
There are n children, who study at the school №41. It is well-known that they are good mathematicians. Once at a break, they arranged a challenge for themselves. All children arranged in a row and tur...
2020-04-09 21:46:27 210
原创 Eugene and an array
Eugene likes working with arrays. And today he needs your help in solving one challenging task.An array c is a subarray of an array b if c can be obtained from b by deletion of several (possibly, zer...
2020-04-09 20:31:35 236
原创 Skyscrapers (hard version)
This is a harder version of the problem. In this version n≤500000The outskirts of the capital are being actively built up in Berland. The company “Kernel Panic” manages the construction of a resident...
2020-04-09 18:36:26 308
原创 Different Rules
B. Different Rulestime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputNikolay has only recently started in competitive programming, but already qu...
2020-04-08 01:37:54 420
原创 Maximum Non-Overlapping Increasing Subsequences
Given a list of integers, we can find an increasing subsequence from that list, i.e., select specific elements from the list where the selected numbers are in increasing order. There is a classic pro...
2020-04-07 22:29:34 202
原创 Multimodal Transport
New methods of shipping goods have transformed the transportation industry and helped usher in an era of global commerce. Nowadays, someone can click a few buttons and have an item leave a factory on...
2020-04-07 01:43:22 838
原创 Rotating Cards
A magician has a stack of n cards labeled 1 through n, in random order. Her trick involves discarding all of the cards in numerical order (first the card labeled 1, then the card labeled 2, etc.). U...
2020-04-06 22:35:19 182
原创 Videogame Probability
You have just joined the illustrious Ewokin guild (group of players) in your favorite video game. This guild is known for attempting the hardest raids the instant that they are released. For these n...
2020-04-06 20:41:27 238
原创 Walk on Matrix
Bob is playing a game named “Walk on Matrix”.In this game, player is given an n×m matrix A=(ai,j), i.e. the element in the i-th row in the j-th column is ai,j. Initially, player is located at positio...
2020-04-06 00:34:07 252
原创 K-Complete Word
Word s of length n is called k-complete ifs is a palindrome, i.e. si=sn+1−i for all 1≤i≤n;s has a period of k, i.e. si=sk+i for all 1≤i≤n−k.For example, “abaaba” is a 3-complete word, while “abccba...
2020-04-05 22:55:32 370
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人