Codeforces Round 991 (Div. 3)

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.

ContestId
Name
Phase
Frozen
Duration (Seconds)
Relative Time
Start Time
2050 Codeforces Round 991 (Div. 3) FINISHED False 8100 42996323 Dec. 5, 2024, 2:35 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 10511 ) F Maximum modulo equality PROGRAMMING data structures math number theory

You are given an array (a) of length (n) and (q) queries (l), (r). For each query, find the maximum possible (m), such that all elements (a_l), (a_{l+1}), ..., (a_r) are equal modulo (m). In other words, (a_l \bmod m = a_{l+1} \bmod m = \dots = a_r \bmod m), where (a \bmod b) — is the remainder of division (a) by (b). In particular, when (m) can be infinite, print (0). The first line contains a single integer (t) ((1 \le t \le 10^4)) — the number of test cases. The first line of each test case contains two integers (n), (q) ((1 \le n, q \le 2\cdot 10^5)) — the length of the array and the number of queries. The second line of each test case contains (n) integers (a_i) ((1 \le a_i \le 10^9)) — the elements of the array. In the following (q) lines of each test case, two integers (l), (r) are provided ((1 \le l \le r \le n)) — the range of the query. It is guaranteed that the sum of (n) across all test cases does not exceed (2\cdot 10^5), and the sum of (q) does not exceed (2\cdot 10^5). For each query, output the maximum value (m) described in the statement. In the first query of the first sample, (6 \bmod 3 = 3 \bmod 3 = 0). It can be shown that for greater (m), the required condition will not be fulfilled. In the third query of the first sample, (14 \bmod 4 = 2 \bmod 4 = 6 \bmod 4 = 2). It can be shown that for greater (m), the required condition will not be fulfilled.

Tutorials

Разбор Codeforces Round 991 (Div. 3)

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
295107335 og.kostya F Dec. 5, 2024, 5:35 p.m. OK C# 10 TESTS 12 171 6144000
295154919 muel_imj F Dec. 6, 2024, 2:55 a.m. OK C++17 (GCC 7-32) TESTS 12 171 4300800
295179944 byebyemyblue F Dec. 6, 2024, 6:03 a.m. OK C++17 (GCC 7-32) TESTS 12 218 13209600
295178004 XianyanXie F Dec. 6, 2024, 5:50 a.m. OK C++17 (GCC 7-32) TESTS 12 218 14028800
295146958 skipher. F Dec. 6, 2024, 2:01 a.m. OK C++17 (GCC 7-32) TESTS 12 218 16896000
295173464 varunguptha F Dec. 6, 2024, 5:16 a.m. OK C++17 (GCC 7-32) TESTS 12 233 0
295119667 afakeusername F Dec. 5, 2024, 7:13 p.m. OK C++17 (GCC 7-32) TESTS 12 233 102400
295100308 sean9575 F Dec. 5, 2024, 5:04 p.m. OK C++17 (GCC 7-32) TESTS 12 233 5632000
295112536 ezluci F Dec. 5, 2024, 6:11 p.m. OK C++17 (GCC 7-32) TESTS 12 233 13209600
295133099 jomathyc F Dec. 5, 2024, 10:23 p.m. OK C++17 (GCC 7-32) TESTS 12 233 14233600
295173858 devendra_1608 F Dec. 6, 2024, 5:18 a.m. OK C++17 (GCC 7-32) TESTS 12 249 16896000
295099915 decltype_t F Dec. 5, 2024, 5:03 p.m. OK C++20 (GCC 13-64) TESTS 12 124 2969600
295163786 zeemanz F Dec. 6, 2024, 3:57 a.m. OK C++20 (GCC 13-64) TESTS 12 186 13004800
295120577 sam990 F Dec. 5, 2024, 7:22 p.m. OK C++20 (GCC 13-64) TESTS 12 186 15257600
295101095 tc_adventureking F Dec. 5, 2024, 5:07 p.m. OK C++20 (GCC 13-64) TESTS 12 186 120320000
295139854 tanaka255 F Dec. 6, 2024, midnight OK C++20 (GCC 13-64) TESTS 12 187 819200
295124958 s169 F Dec. 5, 2024, 8:11 p.m. OK C++20 (GCC 13-64) TESTS 12 187 1638400
295114482 AhmedSalah_ F Dec. 5, 2024, 6:25 p.m. OK C++20 (GCC 13-64) TESTS 12 187 13209600
295106867 Boboge F Dec. 5, 2024, 5:33 p.m. OK C++20 (GCC 13-64) TESTS 12 187 13209600
295136105 enslaved F Dec. 5, 2024, 11:29 p.m. OK C++20 (GCC 13-64) TESTS 12 187 13721600
295110720 huanixel F Dec. 5, 2024, 5:57 p.m. OK C++20 (GCC 13-64) TESTS 12 187 18534400
295137265 MeIoN_is_UMP45 F Dec. 5, 2024, 11:38 p.m. OK C++23 (GCC 14-64, msys2) TESTS 12 93 4915200
295137349 MeIoN_is_UMP45 F Dec. 5, 2024, 11:39 p.m. OK C++23 (GCC 14-64, msys2) TESTS 12 109 307200
295126591 work_class_poem F Dec. 5, 2024, 8:32 p.m. OK C++23 (GCC 14-64, msys2) TESTS 12 171 1843200
295166910 bubbarob19 F Dec. 6, 2024, 4:22 a.m. OK C++23 (GCC 14-64, msys2) TESTS 12 171 11468800
295168564 HugeMouse F Dec. 6, 2024, 4:35 a.m. OK C++23 (GCC 14-64, msys2) TESTS 12 171 14028800
295103304 convective_rain F Dec. 5, 2024, 5:16 p.m. OK C++23 (GCC 14-64, msys2) TESTS 12 171 16896000
295132769 Kolychestiy F Dec. 5, 2024, 10:16 p.m. OK C++23 (GCC 14-64, msys2) TESTS 12 186 14131200
295112293 TianyiChen F Dec. 5, 2024, 6:09 p.m. OK C++23 (GCC 14-64, msys2) TESTS 12 186 15257600
295121735 SlyGaleeb F Dec. 5, 2024, 7:34 p.m. OK C++23 (GCC 14-64, msys2) TESTS 12 187 12492800
295167904 HappyCodingLife. F Dec. 6, 2024, 4:30 a.m. OK C++23 (GCC 14-64, msys2) TESTS 12 187 13004800
295166613 akshatsaxena552004.ss F Dec. 6, 2024, 4:20 a.m. OK Java 21 TESTS 12 436 7372800
295122696 arnabmanna F Dec. 5, 2024, 7:43 p.m. OK Java 21 TESTS 12 515 58880000
295117384 lyongwolf F Dec. 5, 2024, 6:51 p.m. OK Java 21 TESTS 12 530 20684800
295162078 srujan_bunny F Dec. 6, 2024, 3:44 a.m. OK Java 21 TESTS 12 561 22528000
295094500 gamezovladislav F Dec. 5, 2024, 4:48 p.m. OK Java 21 TESTS 12 593 4812800
295094959 prohladenn_vko F Dec. 5, 2024, 4:48 p.m. OK Java 21 TESTS 12 640 4710400
295172665 yang_wei F Dec. 6, 2024, 5:11 a.m. OK Java 21 TESTS 12 655 1126400
295099574 Bidoof F Dec. 5, 2024, 5:02 p.m. OK Java 21 TESTS 12 656 32460800
295124623 BlizGale F Dec. 5, 2024, 8:06 p.m. OK Java 21 TESTS 12 686 9318400
295179422 iamalizaidi F Dec. 6, 2024, 6 a.m. OK Java 21 TESTS 12 703 10444800
295094103 mohit458 F Dec. 5, 2024, 4:47 p.m. OK Java 8 TESTS 12 562 34713600
295131110 Soumadip_Mishra F Dec. 5, 2024, 9:42 p.m. OK Java 8 TESTS 12 1374 0
295156689 Synaptic_Savant F Dec. 6, 2024, 3:09 a.m. OK PyPy 3-64 TESTS 12 296 51507200
295120361 AyuAnchor F Dec. 5, 2024, 7:20 p.m. OK PyPy 3-64 TESTS 12 342 48742400
295139881 pyqjw F Dec. 6, 2024, 12:01 a.m. OK PyPy 3-64 TESTS 12 358 57446400
295167323 hxu10 F Dec. 6, 2024, 4:25 a.m. OK PyPy 3-64 TESTS 12 374 38297600
295148111 smilences F Dec. 6, 2024, 2:10 a.m. OK PyPy 3-64 TESTS 12 390 55296000
295130584 Haksell F Dec. 5, 2024, 9:33 p.m. OK PyPy 3-64 TESTS 12 421 27238400
295150069 smilences F Dec. 6, 2024, 2:22 a.m. OK PyPy 3-64 TESTS 12 437 61337600
295108246 Om_Singh_ F Dec. 5, 2024, 5:41 p.m. OK PyPy 3-64 TESTS 12 452 31539200
295146447 smilences F Dec. 6, 2024, 1:58 a.m. OK PyPy 3-64 TESTS 12 468 33075200
295124540 gardengnome F Dec. 5, 2024, 8:05 p.m. OK PyPy 3-64 TESTS 12 483 32972800
295150705 Th1nhNg0 F Dec. 6, 2024, 2:26 a.m. OK Python 3 TESTS 12 1609 163942400
295098874 ShayahmetovAskar F Dec. 5, 2024, 4:59 p.m. OK Python 3 TESTS 12 1827 37068800
295099548 pleaseusecodew2s F Dec. 5, 2024, 5:02 p.m. OK Python 3 TESTS 12 2406 27545600
295112963 biy F Dec. 5, 2024, 6:14 p.m. OK Python 3 TESTS 12 2577 27750400
295153063 Vss202894_Amt_ul_rehman F Dec. 6, 2024, 2:41 a.m. OK Python 3 TESTS 12 3156 151449600
295108670 Cheshulko F Dec. 5, 2024, 5:44 p.m. OK Rust 2021 TESTS 12 249 63488000
295114074 Allergy527 F Dec. 5, 2024, 6:22 p.m. OK Rust 2021 TESTS 12 265 17510400
295110249 Cheshulko F Dec. 5, 2024, 5:54 p.m. OK Rust 2021 TESTS 12 280 88166400

remove filters

Back to search problems