Codeforces Round 870 (Div. 2)

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
1826 Codeforces Round 870 (Div. 2) FINISHED False 7200 48525899 May 5, 2023, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 18095 ) B Lunatic Never Content PROGRAMMING math number theory 1100

B"You have an array a of n non-negative integers. Let's define f(a, x) = [a_1 bmod x, a_2 bmod x, ... , a_n bmod x] for some positive integer x . Find the biggest x , such that f(a, x) is a palindrome. Here, a bmod x is the remainder of the integer division of a by x . An array is a palindrome if it reads the same backward as forward. More formally, an array a of length n is a palindrome if for every i ( 1 <= q i <= q n ) a_i = a_{n - i + 1} . The first line contains a single integer t ( 1 <= q t <= q 10^5 ) -- the number of test cases. The first line of each test case contains a single integer n ( 1 <= q n <= q 10^5 ). The second line of each test case contains n integers a_i ( 0 <= q a_i <= q 10^9 ). It's guaranteed that the sum of all n does not exceed 10^5 . For each test case output the biggest x , such that f(a, x) is a palindrome. If x can be infinitely large, output 0 instead. In the first example, f(a, x = 1) = [0, 0] which is a palindrome. In the second example, f(a, x = 2) = [1, 0, 1, 0, 0, 1, 0, 1] which is a palindrome. It can be proven that in the first two examples, no larger x satisfies the condition. In the third example, f(a, x) = [0] for any x , so we can choose it infinitely large, so the answer is 0 . "...

Tutorials

Codeforces Round #870 (Div. 2) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
205029389 FatalityNT B May 7, 2023, 10:24 p.m. OK C# 8 TESTS 22 654 10137600 1100
204926265 vjudge1 B May 7, 2023, 5:37 a.m. OK Clang++20 Diagnostics TESTS 22 1123 0 1100
205074018 xodiac B May 8, 2023, 11:26 a.m. OK Clang++20 Diagnostics TESTS 22 1419 409600 1100
205186899 brutal_coder45 B May 9, 2023, 5:43 a.m. OK Clang++20 Diagnostics TESTS 22 1419 819200 1100
205128156 Vium B May 8, 2023, 2:34 p.m. OK Clang++20 Diagnostics TESTS 22 1668 17817600 1100
205820607 Seriously_Its_Sameer B May 14, 2023, 10:32 a.m. OK GNU C11 TESTS 22 405 409600 1100
205066183 666long B May 8, 2023, 9:59 a.m. OK GNU C11 TESTS 22 405 409600 1100
205335506 Anna-Anastasia B May 10, 2023, 1:54 p.m. OK GNU C11 TESTS 22 421 409600 1100
205334910 Anna-Anastasia B May 10, 2023, 1:48 p.m. OK GNU C11 TESTS 22 421 409600 1100
204950617 shshankmittal1111 B May 7, 2023, 9:16 a.m. OK GNU C11 TESTS 22 436 409600 1100
206070450 hupeiyuan B May 16, 2023, 9:53 a.m. OK GNU C++14 TESTS 22 31 819200 1100
204965840 jstzmxuan B May 7, 2023, 11:36 a.m. OK GNU C++14 TESTS 22 31 2560000 1100
204965790 jstzmxuan B May 7, 2023, 11:36 a.m. OK GNU C++14 TESTS 22 31 2560000 1100
205430013 c1120231020 B May 11, 2023, 12:41 p.m. OK GNU C++14 TESTS 22 31 2560000 1100
205713577 gebeng B May 13, 2023, 11:53 a.m. OK GNU C++14 TESTS 22 46 409600 1100
205714255 gebeng B May 13, 2023, noon OK GNU C++14 TESTS 22 46 409600 1100
205777105 zhanglewei4598 B May 14, 2023, 2:32 a.m. OK GNU C++14 TESTS 22 46 409600 1100
205779417 vjudge1 B May 14, 2023, 3:29 a.m. OK GNU C++14 TESTS 22 46 409600 1100
205781719 BrAin B May 14, 2023, 4:13 a.m. OK GNU C++14 TESTS 22 46 409600 1100
205713861 gebeng B May 13, 2023, 11:56 a.m. OK GNU C++14 TESTS 22 46 409600 1100
206142397 altafneutrino_123 B May 16, 2023, 5:56 p.m. OK GNU C++17 TESTS 22 46 409600 1100
205784339 neo11235 B May 14, 2023, 4:59 a.m. OK GNU C++17 TESTS 22 46 409600 1100
205773459 PurpleCrayon B May 14, 2023, 12:29 a.m. OK GNU C++17 TESTS 22 46 409600 1100
205709860 MyCried B May 13, 2023, 11:17 a.m. OK GNU C++17 TESTS 22 46 409600 1100
205505733 ToW_hiD B May 12, 2023, 6:43 a.m. OK GNU C++17 TESTS 22 46 409600 1100
206255430 yogendrabaghel B May 17, 2023, 5:25 p.m. OK GNU C++17 TESTS 22 46 409600 1100
206231302 vikaschoudharycs097 B May 17, 2023, 3:27 p.m. OK GNU C++17 TESTS 22 46 409600 1100
206210799 Earloar B May 17, 2023, 12:38 p.m. OK GNU C++17 TESTS 22 46 409600 1100
206420140 Tunggg B May 19, 2023, 8:13 a.m. OK GNU C++17 TESTS 22 46 409600 1100
206362943 hocln B May 18, 2023, 4:07 p.m. OK GNU C++17 TESTS 22 46 409600 1100
205277708 OTTFF B May 10, 2023, 12:33 a.m. OK GNU C++17 (64) TESTS 22 31 409600 1100
205034749 pyh233 B May 8, 2023, 1:31 a.m. OK GNU C++17 (64) TESTS 22 31 819200 1100
205010349 shubhamgrg1000 B May 7, 2023, 5:31 p.m. OK GNU C++17 (64) TESTS 22 31 819200 1100
206002502 lcpt B May 15, 2023, 3:25 p.m. OK GNU C++17 (64) TESTS 22 31 1945600 1100
205720022 KyuusyouTheSavior B May 13, 2023, 12:53 p.m. OK GNU C++17 (64) TESTS 22 46 409600 1100
205732996 starusc B May 13, 2023, 3 p.m. OK GNU C++17 (64) TESTS 22 46 409600 1100
206038986 newbits B May 16, 2023, 2:03 a.m. OK GNU C++17 (64) TESTS 22 46 409600 1100
206068045 soum1313 B May 16, 2023, 9:28 a.m. OK GNU C++17 (64) TESTS 22 46 409600 1100
206140869 anhkha2003 B May 16, 2023, 5:42 p.m. OK GNU C++17 (64) TESTS 22 46 409600 1100
206426405 SyruLoveNewTechnology B May 19, 2023, 9:13 a.m. OK GNU C++17 (64) TESTS 22 46 409600 1100
206299430 mralves B May 18, 2023, 5:26 a.m. OK GNU C++20 (64) TESTS 22 31 409600 1100
206289044 eggag32 B May 18, 2023, 1:41 a.m. OK GNU C++20 (64) TESTS 22 31 409600 1100
206225010 lilyuan B May 17, 2023, 2:50 p.m. OK GNU C++20 (64) TESTS 22 31 409600 1100
206224991 lilyuan B May 17, 2023, 2:50 p.m. OK GNU C++20 (64) TESTS 22 31 409600 1100
206215061 Hornet_47 B May 17, 2023, 1:16 p.m. OK GNU C++20 (64) TESTS 22 31 409600 1100
206445329 ashu_2004 B May 19, 2023, 12:28 p.m. OK GNU C++20 (64) TESTS 22 31 409600 1100
206432247 tmdh B May 19, 2023, 10:11 a.m. OK GNU C++20 (64) TESTS 22 31 409600 1100
206404212 ratna25Anu B May 19, 2023, 4:52 a.m. OK GNU C++20 (64) TESTS 22 31 409600 1100
206396931 xiuuix B May 19, 2023, 2:27 a.m. OK GNU C++20 (64) TESTS 22 31 409600 1100
206319852 RAVIwaves B May 18, 2023, 9:25 a.m. OK GNU C++20 (64) TESTS 22 31 409600 1100
205695991 Kimi_Zhang B May 13, 2023, 8:59 a.m. OK Go TESTS 22 46 2662400 1100
205133470 codeflitting B May 8, 2023, 3:06 p.m. OK Go TESTS 22 93 2355200 1100
205059332 lordvidex B May 8, 2023, 8:39 a.m. OK Go TESTS 22 327 5120000 1100
205207514 Chelll B May 9, 2023, 9:55 a.m. OK Haskell TESTS 22 763 91443200 1100
204961778 themadknight45 B May 7, 2023, 11 a.m. OK Java 11 TESTS 22 265 0 1100
205943695 vjudge1 B May 15, 2023, 5:27 a.m. OK Java 11 TESTS 22 405 0 1100
206363850 The_terminator B May 18, 2023, 4:16 p.m. OK Java 11 TESTS 22 780 0 1100
206143959 Vaibhav_Rajpal B May 16, 2023, 6:12 p.m. OK Java 11 TESTS 22 795 0 1100
206295893 kasiru_69 B May 18, 2023, 4:23 a.m. OK Java 11 TESTS 22 811 0 1100
205252806 manjeet3k B May 9, 2023, 4:48 p.m. OK Java 11 TESTS 22 1044 0 1100
204919078 sanisu B May 7, 2023, 4:34 a.m. OK Java 11 TESTS 22 1044 0 1100
206253648 2000031380 B May 17, 2023, 5:03 p.m. OK Java 11 TESTS 22 1075 0 1100
205706363 2000031326 B May 13, 2023, 10:43 a.m. OK Java 11 TESTS 22 1075 0 1100
205779777 s945958 B May 14, 2023, 3:36 a.m. OK Java 11 TESTS 22 1076 0 1100
205028915 rated21 B May 7, 2023, 10:10 p.m. OK Java 17 TESTS 22 296 2048000 1100
205290053 bleach__ B May 10, 2023, 5:23 a.m. OK Java 17 TESTS 22 576 512000 1100
205459809 massvinod B May 11, 2023, 5:12 p.m. OK Java 17 TESTS 22 795 819200 1100
205239945 sarthakjoleya B May 9, 2023, 2:51 p.m. OK Java 8 TESTS 22 124 1843200 1100
206311072 MagentaCobra B May 18, 2023, 7:54 a.m. OK Java 8 TESTS 22 140 1843200 1100
205359545 ahmedTarek28 B May 10, 2023, 6:05 p.m. OK Java 8 TESTS 22 155 1945600 1100
206301828 tejasS-27 B May 18, 2023, 6:02 a.m. OK Java 8 TESTS 22 155 2662400 1100
206288143 ZXF_521mua B May 18, 2023, 1:16 a.m. OK Java 8 TESTS 22 436 0 1100
205281714 aniket27 B May 10, 2023, 2:38 a.m. OK Java 8 TESTS 22 733 1843200 1100
205027458 ApocJTL B May 7, 2023, 9:33 p.m. OK Java 8 TESTS 22 951 0 1100
206406213 klsane04 B May 19, 2023, 5:26 a.m. OK Java 8 TESTS 22 966 0 1100
205178038 shbhmgl B May 9, 2023, 2:43 a.m. OK Java 8 TESTS 22 967 0 1100
206345361 sweta_balasundaram B May 18, 2023, 1:27 p.m. OK Java 8 TESTS 22 997 0 1100
205061448 Farewell1022 B May 8, 2023, 9:06 a.m. OK MS C++ 2017 TESTS 22 482 409600 1100
204915161 TheHead B May 7, 2023, 3:24 a.m. OK MS C++ 2017 TESTS 22 483 3993600 1100
206212197 shushukl B May 17, 2023, 12:51 p.m. OK MS C++ 2017 TESTS 22 514 409600 1100
205142473 GeraltLUL B May 8, 2023, 4:20 p.m. OK MS C++ 2017 TESTS 22 529 409600 1100
204984876 EbuYandex B May 7, 2023, 2:24 p.m. OK MS C++ 2017 TESTS 22 529 1740800 1100
205723301 Michele_T B May 13, 2023, 1:22 p.m. OK PyPy 3 TESTS 22 202 10444800 1100
205722970 Michele_T B May 13, 2023, 1:20 p.m. OK PyPy 3 TESTS 22 202 10649600 1100
205267522 Yash_Nandwana B May 9, 2023, 7:53 p.m. OK PyPy 3 TESTS 22 233 11161600 1100
205069760 noob_coder121324 B May 8, 2023, 10:41 a.m. OK PyPy 3 TESTS 22 1855 10854400 1100
205014940 ipip B May 7, 2023, 6:20 p.m. OK PyPy 3 TESTS 22 1871 10956800 1100
205217569 Sentiro B May 9, 2023, 11:39 a.m. OK PyPy 3 TESTS 22 1887 10956800 1100
205509403 lol_py B May 12, 2023, 7:30 a.m. OK PyPy 3 TESTS 22 1933 11059200 1100
205142388 noob_wang B May 8, 2023, 4:19 p.m. OK PyPy 3 TESTS 22 1934 10854400 1100
205146091 2000030255 B May 8, 2023, 4:53 p.m. OK PyPy 3 TESTS 22 1950 10956800 1100
205748115 GK_Leo0 B May 13, 2023, 5:28 p.m. OK PyPy 3 TESTS 22 1964 11161600 1100
205325545 reijnnn B May 10, 2023, 12:24 p.m. OK PyPy 3-64 TESTS 22 140 14131200 1100
205325885 reijnnn B May 10, 2023, 12:27 p.m. OK PyPy 3-64 TESTS 22 140 14233600 1100
206198829 practiceaccount76 B May 17, 2023, 10:50 a.m. OK PyPy 3-64 TESTS 22 155 12083200 1100
206138896 Mayank_Bad B May 16, 2023, 5:25 p.m. OK PyPy 3-64 TESTS 22 155 13619200 1100
205239192 aadi_2 B May 9, 2023, 2:45 p.m. OK PyPy 3-64 TESTS 22 155 13721600 1100
206312653 eugenpaul77 B May 18, 2023, 8:13 a.m. OK PyPy 3-64 TESTS 22 155 16691200 1100
205965755 Karthik1106 B May 15, 2023, 10:02 a.m. OK PyPy 3-64 TESTS 22 155 24473600 1100
205779944 s945958 B May 14, 2023, 3:40 a.m. OK PyPy 3-64 TESTS 22 156 24473600 1100
206321245 thuonguyenvan B May 18, 2023, 9:40 a.m. OK PyPy 3-64 TESTS 22 170 13926400 1100
205823509 Admiring_ShockleyZns B May 14, 2023, 10:59 a.m. OK PyPy 3-64 TESTS 22 170 17715200 1100
205208994 ALSTON16 B May 9, 2023, 10:10 a.m. OK Python 3 TESTS 22 389 13209600 1100
205055515 daotiennamhlvl B May 8, 2023, 7:53 a.m. OK Python 3 TESTS 22 748 13414400 1100
205052087 isPritchin B May 8, 2023, 7:09 a.m. OK Python 3 TESTS 22 763 13414400 1100
205631077 Pavan125 B May 12, 2023, 6 p.m. OK Python 3 TESTS 22 764 13209600 1100
205496440 2000030045 B May 12, 2023, 4:25 a.m. OK Python 3 TESTS 22 764 13209600 1100
206099616 ZY_zhangyin B May 16, 2023, 2:28 p.m. OK Python 3 TESTS 22 764 13414400 1100
205470551 kkhyathi B May 11, 2023, 7:03 p.m. OK Python 3 TESTS 22 764 13414400 1100
206019352 sridharsiddi B May 15, 2023, 6:24 p.m. OK Python 3 TESTS 22 779 13209600 1100
205124662 sullar B May 8, 2023, 2:12 p.m. OK Python 3 TESTS 22 779 13209600 1100
206088870 mydlee B May 16, 2023, 12:51 p.m. OK Python 3 TESTS 22 779 13824000 1100
204921170 Spheniscine B May 7, 2023, 5:02 a.m. OK Rust 2021 TESTS 22 31 512000 1100
205058807 cottoncotton B May 8, 2023, 8:34 a.m. OK Rust 2021 TESTS 22 31 67686400 1100
205161180 kost B May 8, 2023, 7:47 p.m. OK Rust 2021 TESTS 22 810 9011200 1100

remove filters

Back to search problems