Solutions are presented as using the least memory and the fastest execution time. It also takes the top
10 most recent solutions from each language. If you want to limit to a specific index, click the
"Solved" button and go to that problem.
Problems
B"There're n robots placed on a number line. Initially, i -th of them occupies unit segment [x_i, x_i + 1] . Each robot has a program, consisting of k instructions numbered from 1 to k . The robot performs instructions in a cycle. Each instruction is described by an integer number. Let's denote the number corresponding to the j -th instruction of the i -th robot as f_{i, j} . Initial placement of robots corresponds to the moment of time 0 . During one second from moment of time t ( 0 <= t ) until t + 1 the following process occurs: An illustration of the process happening during one second: Rectangles represent robots. Numbers inside rectangles correspond to instructions of robots. The final division into groups is marked with arcs. Below are the positions of the robots after moving. Only the left of the two rightmost groups moved. That's because these two groups tried to move towards each other, and were separated by exactly one unit segment. Look at the examples for a better understanding of the process. You need to answer several questions. What is the position of a_i -th robot at the moment of time t_i ? The first line contains two integer numbers n and k -- the number of robots and the number of instructions in the program of one robot ( 1 <= n <= 100 , 1 <= k <= 50 ). The next line contains n integer numbers x_i -- positions of robots at moment of time 0 ( -10^9 <= x_1 < x_2 < ... < x_n < 10^9 ). The next n lines contain descriptions of robots' programs. The i -th of these lines contains k integer numbers f_{i, j} ( |f_{i, j}| <= 10^6 ). The next line contains a single integer number q -- the number of questions you to answer ( 1 <= q <= 1000 ). The next q lines contain two integer number a_i and t_i each, meaning that you should find a position of a_i -t"... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
137282741 |
rainboy |
H |
Nov. 28, 2021, 9:47 p.m. |
OK |
GNU C11 |
TESTS |
34 |
295 |
102400 |
|
3500 |
137269691 |
Radewoosh |
H |
Nov. 28, 2021, 5:36 p.m. |
OK |
GNU C++14 |
TESTS |
34 |
452 |
16384000 |
|
3500 |
137312237 |
A_M--Unstoppable |
H |
Nov. 29, 2021, 5:45 a.m. |
OK |
GNU C++17 |
TESTS |
34 |
93 |
24780800 |
|
3500 |
137263072 |
tourist |
H |
Nov. 28, 2021, 4:45 p.m. |
OK |
GNU C++17 (64) |
TESTS |
34 |
62 |
24780800 |
|
3500 |
137291010 |
xay5421 |
H |
Nov. 29, 2021, 3:23 a.m. |
OK |
GNU C++17 (64) |
TESTS |
34 |
93 |
819200 |
|
3500 |
137272616 |
ksun48 |
H |
Nov. 28, 2021, 6:08 p.m. |
OK |
GNU C++17 (64) |
TESTS |
34 |
483 |
409600 |
|
3500 |
137272026 |
ksun48 |
H |
Nov. 28, 2021, 6 p.m. |
OK |
GNU C++17 (64) |
TESTS |
34 |
499 |
409600 |
|
3500 |
137273636 |
Krolo7 |
H |
Nov. 28, 2021, 6:23 p.m. |
OK |
GNU C++20 (64) |
TESTS |
34 |
561 |
409600 |
|
3500 |
remove filters
Back to search problems