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'You are a warrior fighting against the machine god Thor. Thor challenge you to solve the following problem: There are n conveyors arranged in a line numbered with integers from 1 to n from left to right. Each conveyor has a symbol "<" or ">". The initial state of the conveyor i is equal to the i -th character of the string s . There are n+1 holes numbered with integers from 0 to n . The hole 0 is on the left side of the conveyor 1 , and for all i geq 1 the hole i is on the right side of the conveyor i . When a ball is on the conveyor i , the ball moves by the next rules: If the symbol "<" is on the conveyor i , then: If the symbol ">" is on the conveyor i , then: You should answer next q queries, each query is defined by the pair of integers l, r ( 1 <= q l <= q r <= q n ): The first line contains two integers n , q ( 1 <= n <= 5 x 10^5 , 1 <= q <= 10^5 ). The second line contains a string s of length n . It consists of characters "<" and ">". Next q lines contain the descriptions of the queries, i -th of them contains two integers l , r (1 <= l <= r <= n) , describing the i -th query. Print q lines, in the i -th of them print the answer to the i -th query. '... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
85692125 |
rainboy |
F |
July 1, 2020, 3:28 p.m. |
OK |
GNU C11 |
TESTS |
60 |
810 |
47308800 |
|
|
85700669 |
physics0523 |
F |
July 1, 2020, 4:51 p.m. |
OK |
GNU C11 |
TESTS |
60 |
951 |
110284800 |
|
|
85724192 |
xay5421 |
F |
July 1, 2020, 11:55 p.m. |
OK |
GNU C++11 |
TESTS |
60 |
218 |
96972800 |
|
|
85681350 |
Chloristendika |
F |
July 1, 2020, 3:06 p.m. |
OK |
GNU C++11 |
TESTS |
60 |
265 |
96665600 |
|
|
85720470 |
frodakcin |
F |
July 1, 2020, 9:38 p.m. |
OK |
GNU C++11 |
TESTS |
60 |
296 |
30003200 |
|
|
85740584 |
Frame233 |
F |
July 2, 2020, 5:58 a.m. |
OK |
GNU C++11 |
TESTS |
60 |
311 |
60620800 |
|
|
85735993 |
atoiz |
F |
July 2, 2020, 4:47 a.m. |
OK |
GNU C++11 |
TESTS |
60 |
358 |
68505600 |
|
|
85725974 |
emoairx |
F |
July 2, 2020, 1 a.m. |
OK |
GNU C++11 |
TESTS |
60 |
420 |
106803200 |
|
|
85699885 |
jeffyang |
F |
July 1, 2020, 4:48 p.m. |
OK |
GNU C++11 |
TESTS |
60 |
451 |
122777600 |
|
|
85738890 |
dysyn1314 |
F |
July 2, 2020, 5:35 a.m. |
OK |
GNU C++11 |
TESTS |
60 |
514 |
84787200 |
|
|
85734681 |
albeXL |
F |
July 2, 2020, 4:24 a.m. |
OK |
GNU C++11 |
TESTS |
60 |
530 |
99225600 |
|
|
85698690 |
eriksuenderhauf |
F |
July 1, 2020, 4:44 p.m. |
OK |
GNU C++11 |
TESTS |
60 |
545 |
197427200 |
|
|
85695526 |
danya090699 |
F |
July 1, 2020, 3:33 p.m. |
OK |
GNU C++14 |
TESTS |
60 |
295 |
64614400 |
|
|
85712419 |
MarcosK |
F |
July 1, 2020, 6:52 p.m. |
OK |
GNU C++14 |
TESTS |
60 |
514 |
83251200 |
|
|
85711032 |
MarcosK |
F |
July 1, 2020, 6:32 p.m. |
OK |
GNU C++14 |
TESTS |
60 |
529 |
75161600 |
|
|
85699483 |
QCFium |
F |
July 1, 2020, 4:46 p.m. |
OK |
GNU C++14 |
TESTS |
60 |
530 |
35225600 |
|
|
85688877 |
QCFium |
F |
July 1, 2020, 3:21 p.m. |
OK |
GNU C++14 |
TESTS |
60 |
530 |
35328000 |
|
|
85675650 |
tmwilliamlin168 |
F |
July 1, 2020, 2:54 p.m. |
OK |
GNU C++14 |
TESTS |
60 |
545 |
48332800 |
|
|
85715139 |
retawB |
F |
July 1, 2020, 7:34 p.m. |
OK |
GNU C++14 |
TESTS |
60 |
717 |
107212800 |
|
|
85705880 |
keko37 |
F |
July 1, 2020, 5:33 p.m. |
OK |
GNU C++14 |
TESTS |
60 |
1106 |
34816000 |
|
|
85689580 |
malfple |
F |
July 1, 2020, 3:23 p.m. |
OK |
GNU C++14 |
TESTS |
60 |
1996 |
71065600 |
|
|
85698774 |
okwedook |
F |
July 1, 2020, 4:44 p.m. |
OK |
GNU C++17 |
TESTS |
60 |
343 |
51507200 |
|
|
85673830 |
Mehrdad_Sohrabi |
F |
July 1, 2020, 2:50 p.m. |
OK |
GNU C++17 |
TESTS |
60 |
343 |
88883200 |
|
|
85702933 |
eisen_shinzou |
F |
July 1, 2020, 5:06 p.m. |
OK |
GNU C++17 |
TESTS |
60 |
358 |
51507200 |
|
|
85709576 |
Marisa |
F |
July 1, 2020, 6:14 p.m. |
OK |
GNU C++17 |
TESTS |
60 |
358 |
322867200 |
|
|
85704332 |
atodo |
F |
July 1, 2020, 5:18 p.m. |
OK |
GNU C++17 |
TESTS |
60 |
389 |
105779200 |
|
|
85699309 |
RUSH_D_CAT |
F |
July 1, 2020, 4:46 p.m. |
OK |
GNU C++17 |
TESTS |
60 |
389 |
121036800 |
|
|
85702092 |
aropan |
F |
July 1, 2020, 5 p.m. |
OK |
GNU C++17 |
TESTS |
60 |
390 |
97280000 |
|
|
85695509 |
mango_lassi |
F |
July 1, 2020, 3:33 p.m. |
OK |
GNU C++17 |
TESTS |
60 |
436 |
45465600 |
|
|
85730050 |
anodiebird |
F |
July 2, 2020, 2:47 a.m. |
OK |
GNU C++17 |
TESTS |
60 |
436 |
88678400 |
|
|
85695495 |
hitman623 |
F |
July 1, 2020, 3:33 p.m. |
OK |
GNU C++17 |
TESTS |
60 |
436 |
93491200 |
|
|
85709370 |
ecnerwala |
F |
July 1, 2020, 6:11 p.m. |
OK |
GNU C++17 (64) |
TESTS |
60 |
296 |
37376000 |
|
|
85708464 |
kefaa2 |
F |
July 1, 2020, 6 p.m. |
OK |
GNU C++17 (64) |
TESTS |
60 |
327 |
82944000 |
|
|
85708566 |
kefaa2 |
F |
July 1, 2020, 6:01 p.m. |
OK |
GNU C++17 (64) |
TESTS |
60 |
327 |
82944000 |
|
|
85700969 |
Marckess |
F |
July 1, 2020, 4:53 p.m. |
OK |
GNU C++17 (64) |
TESTS |
60 |
358 |
104755200 |
|
|
85698828 |
Marckess |
F |
July 1, 2020, 4:45 p.m. |
OK |
GNU C++17 (64) |
TESTS |
60 |
373 |
104960000 |
|
|
85672559 |
emengdeath |
F |
July 1, 2020, 2:48 p.m. |
OK |
GNU C++17 (64) |
TESTS |
60 |
436 |
64614400 |
|
|
85688747 |
chemthan |
F |
July 1, 2020, 3:21 p.m. |
OK |
GNU C++17 (64) |
TESTS |
60 |
436 |
99532800 |
|
|
85730638 |
lsantire |
F |
July 2, 2020, 3 a.m. |
OK |
GNU C++17 (64) |
TESTS |
60 |
452 |
99020800 |
|
|
85662794 |
kostia244 |
F |
July 1, 2020, 2:29 p.m. |
OK |
GNU C++17 (64) |
TESTS |
60 |
452 |
144691200 |
|
|
85695624 |
risujiroh |
F |
July 1, 2020, 3:34 p.m. |
OK |
GNU C++17 (64) |
TESTS |
60 |
467 |
32870400 |
|
|
85722474 |
Oopsimbad |
F |
July 1, 2020, 10:44 p.m. |
OK |
Java 11 |
TESTS |
60 |
2183 |
96256000 |
|
|
85704174 |
Tlatoani |
F |
July 1, 2020, 5:16 p.m. |
OK |
Kotlin |
TESTS |
60 |
1622 |
151244800 |
|
|
85698834 |
sansen |
F |
July 1, 2020, 4:45 p.m. |
OK |
Rust |
TESTS |
60 |
530 |
90112000 |
|
|
85692155 |
kobae964 |
F |
July 1, 2020, 3:28 p.m. |
OK |
Rust |
TESTS |
60 |
701 |
55603200 |
|
|
remove filters
Back to search problems