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"Alice and Bob are swimming in the pool under the guidance of their instructor Monocarp. The pool can be represented as a segment on the OX-axis from 0 to 50 . Both Alice and Bob started at moment 0 at point 0 with positive real speeds v_A and v_B correspondingly. Both Alice and Bob swim from 0 to point 50 , then instantly turn back and swim from 50 to 0 . At 0 they turn back again and swim to 50 and so on. Monocarp logged all valuable info about Alice and Bob, including moments of time when they met at the same point (Alice and Bob swim on parallel lanes, so they don't bother each other). Let's name that moments of time as sequence t_1, t_2, ... , t_n . Due to some incident, Monocarp lost almost all data he recorded, and all he has now is array t . Monocarp remembers that Alice and Bob had distinct positive real swimming speeds v_A and v_B ( v_A > 0 ; v_B > 0 ; v_A neq v_B ) and that sequence t contains the first n meeting moments. But looking at sequence t he noticed that all t_i are integer values, and now he doubts is sequence t valid or there are some errors in it. Help Monocarp to check array t ! The first line contains a single integer c ( 1 <= c <= 10^4 ) -- the number of test cases. Then c cases follow. The first line of each test case contains a single integer n ( 1 <= n <= 2 cdot 10^5 ) -- the size of array t . The second line of each test case contains n integers t_1, t_2, ... , t_n ( 1 <= t_1 < t_2 < ... < t_n <= 10^9 ) -- the meeting moments in the increasing order. It's guaranteed that the sum of n over all test cases doesn't exceed 2 cdot 10^5 . For each test case, print VALID if the array t is a valid array, or (in other words) exist such real values v_A and v_B ( v_A, v_B > 0 ; v_A neq v_B ) that ar"... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
236810039 |
s-lissov |
G |
Dec. 11, 2023, 4:37 p.m. |
OK |
Kotlin 1.7 |
TESTS |
31 |
436 |
46694400 |
|
|
236804344 |
pashka |
G |
Dec. 11, 2023, 3:54 p.m. |
OK |
Kotlin 1.7 |
TESTS |
31 |
467 |
54681600 |
|
|
236798734 |
arvindf232 |
G |
Dec. 11, 2023, 3:18 p.m. |
OK |
Kotlin 1.7 |
TESTS |
31 |
639 |
50585600 |
|
|
236802997 |
tabr |
G |
Dec. 11, 2023, 3:45 p.m. |
OK |
Kotlin 1.7 |
TESTS |
31 |
733 |
107417600 |
|
|
236801587 |
Potassium |
G |
Dec. 11, 2023, 3:36 p.m. |
OK |
Kotlin 1.7 |
TESTS |
31 |
826 |
106700800 |
|
|
236804842 |
Golovanov399 |
G |
Dec. 11, 2023, 3:58 p.m. |
OK |
Kotlin 1.7 |
TESTS |
31 |
982 |
69529600 |
|
|
236799821 |
xiaowuc1 |
G |
Dec. 11, 2023, 3:24 p.m. |
OK |
Kotlin 1.7 |
TESTS |
31 |
1029 |
113356800 |
|
|
236806494 |
yudedako |
G |
Dec. 11, 2023, 4:10 p.m. |
OK |
Kotlin 1.7 |
TESTS |
31 |
1029 |
123187200 |
|
|
236805321 |
wsyear |
G |
Dec. 11, 2023, 4:01 p.m. |
OK |
Kotlin 1.7 |
TESTS |
31 |
1154 |
80691200 |
|
|
236836330 |
chappy1 |
G |
Dec. 11, 2023, 9:32 p.m. |
OK |
Kotlin 1.7 |
TESTS |
31 |
1262 |
146841600 |
|
|
236803415 |
Kude |
G |
Dec. 11, 2023, 3:48 p.m. |
OK |
Kotlin 1.9 |
TESTS |
31 |
686 |
60723200 |
|
|
236809626 |
shnirelman |
G |
Dec. 11, 2023, 4:33 p.m. |
OK |
Kotlin 1.9 |
TESTS |
31 |
701 |
61132800 |
|
|
236843232 |
cmk666 |
G |
Dec. 12, 2023, 12:53 a.m. |
OK |
Kotlin 1.9 |
TESTS |
31 |
701 |
99020800 |
|
|
236800494 |
tourist |
G |
Dec. 11, 2023, 3:29 p.m. |
OK |
Kotlin 1.9 |
TESTS |
31 |
702 |
61440000 |
|
|
236809794 |
shade34 |
G |
Dec. 11, 2023, 4:35 p.m. |
OK |
Kotlin 1.9 |
TESTS |
31 |
716 |
61644800 |
|
|
236845482 |
Darren0724 |
G |
Dec. 12, 2023, 2 a.m. |
OK |
Kotlin 1.9 |
TESTS |
31 |
732 |
70758400 |
|
|
236808548 |
franv |
G |
Dec. 11, 2023, 4:25 p.m. |
OK |
Kotlin 1.9 |
TESTS |
31 |
764 |
66048000 |
|
|
236802763 |
Tlatoani |
G |
Dec. 11, 2023, 3:44 p.m. |
OK |
Kotlin 1.9 |
TESTS |
31 |
951 |
124108800 |
|
|
236850257 |
Benq |
G |
Dec. 12, 2023, 3:48 a.m. |
OK |
Kotlin 1.9 |
TESTS |
31 |
982 |
163123200 |
|
|
236809978 |
errorgorn |
G |
Dec. 11, 2023, 4:37 p.m. |
OK |
Kotlin 1.9 |
TESTS |
31 |
1122 |
144691200 |
|
|
remove filters
Back to search problems