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
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
( 339 ) |
F |
Mars |
PROGRAMMING |
|
|
|
B'In the year 2420 humans have finally built a colony on Mars thanks to the work of Elon Tusk. There are 10^9+7 cities arranged in a circle in this colony and none of them are connected yet. Elon Tusk wants to connect some of those cities using only roads of the same size in order to lower the production cost of those roads. Because of that he gave a list on N cites where some cites can appear more than once and Q queries that you need to answer. For the query you need to determine if it is possible to connect all the cities from L_{i} to R_{i} on that list using only roads of length D_{i} . The first line contains two integers N and Q ( 1 <= q N, Q <= q 2 cdot10^5 ) -- the length of the array of cities and the number of queries you need to answer. The second lines contains N integers representing the array of cites. Next Q lines contain three integers L, R and D ( 1 <= q L_{i}, R_{i} <= q N , 0 <= q D_{i} <= q 10^9+6 ) -- the range of cities that needs to be connected and the length of the road that you can use. The output contains Q lines. If it is possible to connect all the cities from the i-th query can be connected with roads of length D_{i} the i-th line should contain the word "Yes", otherwise it should contain the word "No". In the 5^{th} query of the first test case we can connect cities in this order 0-2-4-6-8-10-12 this way distance between any two connected cities is 2. In the second test case we can connect cities in this order 21-14-7-0 this way distance between any two connected cities is 10^9 module 10^9+7 . '... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
131324971 |
yz6205 AhoCorasick Comet_Honeymoon |
F |
Oct. 9, 2021, 12:15 p.m. |
OK |
GNU C++14 |
TESTS |
19 |
436 |
71372800 |
|
|
131317011 |
MoRanSky A.K.E.E. Fulisike |
F |
Oct. 9, 2021, 11:09 a.m. |
OK |
GNU C++14 |
TESTS |
19 |
577 |
56627200 |
|
|
131322725 |
A-SOUL_Bella A-SOUL_Ava A-SOUL_Eileen |
F |
Oct. 9, 2021, 11:55 a.m. |
OK |
GNU C++14 |
TESTS |
19 |
1185 |
130355200 |
|
|
131344868 |
BlueDiamond |
F |
Oct. 9, 2021, 3:46 p.m. |
OK |
GNU C++14 |
TESTS |
19 |
1887 |
116019200 |
|
|
131317391 |
Um_nik Ormlis |
F |
Oct. 9, 2021, 11:12 a.m. |
OK |
GNU C++17 |
TESTS |
19 |
358 |
10137600 |
|
|
131320102 |
Cornflakes leapfrog DPair |
F |
Oct. 9, 2021, 11:34 a.m. |
OK |
GNU C++17 |
TESTS |
19 |
451 |
15769600 |
|
|
131322803 |
zhangguangxuan99 nvmdava Maripium |
F |
Oct. 9, 2021, 11:56 a.m. |
OK |
GNU C++17 |
TESTS |
19 |
577 |
145100800 |
|
|
131324987 |
lindongli2004 qazswedx2 Chameleon216 |
F |
Oct. 9, 2021, 12:16 p.m. |
OK |
GNU C++17 |
TESTS |
19 |
639 |
78438400 |
|
|
131315752 |
xay5421 LJC00118 |
F |
Oct. 9, 2021, 10:58 a.m. |
OK |
GNU C++17 |
TESTS |
19 |
686 |
35942400 |
|
|
131320634 |
Cirno_9baka ChthollyNotaSeniorious JeovaSantusUnus |
F |
Oct. 9, 2021, 11:39 a.m. |
OK |
GNU C++17 |
TESTS |
19 |
748 |
17408000 |
|
|
131313964 |
6aren dai chemthan |
F |
Oct. 9, 2021, 10:43 a.m. |
OK |
GNU C++17 |
TESTS |
19 |
842 |
44646400 |
|
|
131328734 |
user202729_ tanphatls987 |
F |
Oct. 9, 2021, 12:52 p.m. |
OK |
GNU C++17 |
TESTS |
19 |
1060 |
19865600 |
|
|
131371084 |
cookiedoth rqi Egor.Lifar |
F |
Oct. 10, 2021, 1:23 a.m. |
OK |
GNU C++17 |
TESTS |
19 |
1856 |
80179200 |
|
|
131311177 |
oolimry icypiggy errorgorn |
F |
Oct. 9, 2021, 10:20 a.m. |
OK |
GNU C++17 (64) |
TESTS |
19 |
234 |
28364800 |
|
|
131324118 |
OIerwanhong |
F |
Oct. 9, 2021, 12:07 p.m. |
OK |
GNU C++17 (64) |
TESTS |
19 |
265 |
10752000 |
|
|
131327213 |
krimzon Clovers |
F |
Oct. 9, 2021, 12:38 p.m. |
OK |
GNU C++17 (64) |
TESTS |
19 |
327 |
7475200 |
|
|
131369905 |
SevenDawns |
F |
Oct. 10, 2021, 12:13 a.m. |
OK |
GNU C++17 (64) |
TESTS |
19 |
327 |
9113600 |
|
|
131310012 |
AutumnKite Alan233 froggyzhang |
F |
Oct. 9, 2021, 10:11 a.m. |
OK |
GNU C++17 (64) |
TESTS |
19 |
390 |
27443200 |
|
|
131323795 |
_yui_ 77o |
F |
Oct. 9, 2021, 12:04 p.m. |
OK |
GNU C++17 (64) |
TESTS |
19 |
420 |
47308800 |
|
|
131328105 |
_runtimeTerror_ DenOMINATOR rivalq |
F |
Oct. 9, 2021, 12:46 p.m. |
OK |
GNU C++17 (64) |
TESTS |
19 |
482 |
50688000 |
|
|
131321008 |
orzdevinwang |
F |
Oct. 9, 2021, 11:42 a.m. |
OK |
GNU C++17 (64) |
TESTS |
19 |
546 |
36147200 |
|
|
131313765 |
HJKL1018 Forever_Pursuit George1123 |
F |
Oct. 9, 2021, 10:41 a.m. |
OK |
GNU C++17 (64) |
TESTS |
19 |
623 |
33792000 |
|
|
131330023 |
Kaban-5 gnomina007 nikgaevoy |
F |
Oct. 9, 2021, 1:03 p.m. |
OK |
GNU C++17 (64) |
TESTS |
19 |
670 |
28467200 |
|
|
131329526 |
tuna_salad |
F |
Oct. 9, 2021, 12:59 p.m. |
OK |
Rust |
TESTS |
19 |
311 |
28262400 |
|
|
131329281 |
tuna_salad |
F |
Oct. 9, 2021, 12:57 p.m. |
OK |
Rust |
TESTS |
19 |
311 |
28876800 |
|
|
remove filters
Back to search problems