Codeforces Round 1084 (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
2200 Codeforces Round 1084 (Div. 3) FINISHED False 8100 4202723 Feb. 27, 2026, 2:35 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 429 ) H Six Seven PROGRAMMING divide and conquer math number theory strings trees

For positive integers (i) and (j), define (f_i(j)) as the maximum integer (k) such that (i^k) divides (j). A number (j) is considered special if (f_6(j) \gt f_7(j)). For example, (6) is special , but (67) and (7) are not. You are given an array (a) of (n) positive integers. In one operation, you must increase every element in the array by (1). Your task is to find the minimum number of operations needed to make all elements in (a) special at the same time, or determine that it is impossible. The first line contains an integer (t) ((1 \leq t \leq 10^4)), the number of test cases. For each test case, the first line contains an integer (n) ((1 \leq n \leq 2 \cdot 10^5)). The second line of each test case contains (n) integers (a_1, a_2, \dots, a_n) ((1 \leq a_i \leq 10^9)). The sum of (n) over all test cases does not exceed (2 \cdot 10^5). For each test case, output a single integer: the minimum number of operations to make all elements special at the same time, or (-1) if it is impossible. In the first test case, all elements cannot be made special at the same time. In the second test case, performing (5) operations results in the array (30,72), whose elements are all special. In the fourth test case, the array becomes (9557358) after (7) operations.

Tutorials

Codeforces Round 1084 (Div. 3) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
364735403 mubai_0x3f H Feb. 27, 2026, 4:59 p.m. OK C++17 (GCC 7-32) TESTS 8 78 0
364758010 AntiBsayer H Feb. 27, 2026, 8:20 p.m. OK C++17 (GCC 7-32) TESTS 8 93 4096000
364732542 darkmatter_druid H Feb. 27, 2026, 4:48 p.m. OK C++17 (GCC 7-32) TESTS 8 109 17510400
364725333 potato167 H Feb. 27, 2026, 4:31 p.m. OK C++17 (GCC 7-32) TESTS 8 125 0
364755871 kiarash_GIATpasand H Feb. 27, 2026, 7:59 p.m. OK C++17 (GCC 7-32) TESTS 8 125 20889600
364742308 IceKnight2000 H Feb. 27, 2026, 5:53 p.m. OK C++17 (GCC 7-32) TESTS 8 125 25292800
364747196 m.ikrashmughal H Feb. 27, 2026, 6:37 p.m. OK C++17 (GCC 7-32) TESTS 8 140 20889600
364780827 zcy20292027 H Feb. 28, 2026, 3:38 a.m. OK C++17 (GCC 7-32) TESTS 8 156 20889600
364733603 Francisco-gmail-com H Feb. 27, 2026, 4:49 p.m. OK C++17 (GCC 7-32) TESTS 8 281 64614400
364785200 longlk H Feb. 28, 2026, 4:57 a.m. OK C++17 (GCC 7-32) TESTS 8 390 5324800
364774133 fisher199 H Feb. 28, 2026, 1:16 a.m. OK C++20 (GCC 13-64) TESTS 8 62 0
364774294 fisher199 H Feb. 28, 2026, 1:19 a.m. OK C++20 (GCC 13-64) TESTS 8 62 102400
364738390 BingxiuXie H Feb. 27, 2026, 5:19 p.m. OK C++20 (GCC 13-64) TESTS 8 62 1638400
364734774 Yuki_Riku H Feb. 27, 2026, 4:55 p.m. OK C++20 (GCC 13-64) TESTS 8 62 11264000
364737868 AlRntn H Feb. 27, 2026, 5:15 p.m. OK C++20 (GCC 13-64) TESTS 8 62 21811200
364774106 fisher199 H Feb. 28, 2026, 1:16 a.m. OK C++20 (GCC 13-64) TESTS 8 78 0
364734600 Kude H Feb. 27, 2026, 4:54 p.m. OK C++20 (GCC 13-64) TESTS 8 78 0
364724557 ntvl H Feb. 27, 2026, 4:29 p.m. OK C++20 (GCC 13-64) TESTS 8 78 0
364726601 imaiwluv H Feb. 27, 2026, 4:34 p.m. OK C++20 (GCC 13-64) TESTS 8 78 1843200
364773890 sukon H Feb. 28, 2026, 1:11 a.m. OK C++20 (GCC 13-64) TESTS 8 78 3993600
364758622 MahmoudBassem H Feb. 27, 2026, 8:26 p.m. OK C++23 (GCC 14-64, msys2) TESTS 8 62 0
364756030 MahmoudBassem H Feb. 27, 2026, 8:01 p.m. OK C++23 (GCC 14-64, msys2) TESTS 8 62 0
364749869 everflame H Feb. 27, 2026, 7:04 p.m. OK C++23 (GCC 14-64, msys2) TESTS 8 62 0
364748486 4M49_H3R3 H Feb. 27, 2026, 6:50 p.m. OK C++23 (GCC 14-64, msys2) TESTS 8 62 0
364731042 xiaoxiaobaozi H Feb. 27, 2026, 4:45 p.m. OK C++23 (GCC 14-64, msys2) TESTS 8 62 0
364729919 Arkaan H Feb. 27, 2026, 4:42 p.m. OK C++23 (GCC 14-64, msys2) TESTS 8 62 0
364729523 Megh1710 H Feb. 27, 2026, 4:41 p.m. OK C++23 (GCC 14-64, msys2) TESTS 8 62 0
364734040 pppwolf H Feb. 27, 2026, 4:52 p.m. OK C++23 (GCC 14-64, msys2) TESTS 8 62 409600
364777001 Tomate H Feb. 28, 2026, 2:23 a.m. OK C++23 (GCC 14-64, msys2) TESTS 8 62 2048000
364724550 awyl H Feb. 27, 2026, 4:29 p.m. OK C++23 (GCC 14-64, msys2) TESTS 8 62 2048000
364777460 psun256 H Feb. 28, 2026, 2:33 a.m. OK GNU C11 TESTS 8 156 9728000
364730929 jdltc H Feb. 27, 2026, 4:44 p.m. OK Java 21 TESTS 8 281 2150400
364724706 kdy8128 H Feb. 27, 2026, 4:29 p.m. OK PyPy 3-64 TESTS 8 156 27238400
364790556 smilences H Feb. 28, 2026, 6:01 a.m. OK PyPy 3-64 TESTS 9 156 32870400
364729798 kunal_13 H Feb. 27, 2026, 4:42 p.m. OK PyPy 3-64 TESTS 8 250 46796800
364747307 shuracodes H Feb. 27, 2026, 6:38 p.m. OK PyPy 3-64 TESTS 8 296 71372800
364734625 Little_Sheep_Yawn H Feb. 27, 2026, 4:54 p.m. OK PyPy 3-64 TESTS 8 437 32665600
364734926 Little_Sheep_Yawn H Feb. 27, 2026, 4:56 p.m. OK PyPy 3-64 TESTS 8 437 32972800
364739102 Friedrich H Feb. 27, 2026, 5:24 p.m. OK PyPy 3-64 TESTS 8 437 57958400
364724355 harurun4635 H Feb. 27, 2026, 4:29 p.m. OK PyPy 3-64 TESTS 8 593 27648000
364729078 Rohit_Roy_1037 H Feb. 27, 2026, 4:40 p.m. OK Python 3 TESTS 8 265 27033600
364790629 smilences H Feb. 28, 2026, 6:01 a.m. OK Python 3 TESTS 9 1437 33587200

remove filters

Back to search problems