Codeforces Round 1026 (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
2110 Codeforces Round 1026 (Div. 2) FINISHED False 7200 28308323 May 24, 2025, 2:35 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 1897 ) F Faculty PROGRAMMING brute force math number theory

In 2077, after the world was enslaved by robots, the robots decided to implement an educational reform, and now the operation of taking the modulus is only taught in the faculty of "Ancient World History". Here is one of the entrance tasks for this faculty: We define the beauty of an array of positive integers (b) as the maximum (f(b_i, b_j)) over all pairs (1 \leq i, j \leq n), where (f(x, y) = (x \bmod y) + (y \bmod x)). Given an array of positive integers (a) of length (n), output (n) numbers, where the (i)-th number ((1 \leq i \leq n)) is the beauty of the array (a_1, a_2, \ldots, a_i). (x \bmod y) is the remainder of the division of (x) by (y). Each test contains multiple test cases. The first line contains the number of test cases (t) ((1 \le t \le 10^4)). The description of the test cases follows. The first line of each test case contains a single integer (n) ((1 \leq n \leq 10^6)) — the size of the array (a). The second line of each test case contains (n) integers (a_1, a_2, \ldots, a_n) ((1 \leq a_i \leq 10^9)). It is guaranteed that the sum of (n) across all test cases does not exceed (10^6). For each test case, output (n) integers — the beauties of all prefixes of the array (a). The beauty of the array (3) is (0). The beauty of the array (3, 1) is (f(3, 1) = 1). The beauty of the array (3, 1, 4) is (f(3, 4) = 4). The beauty of the array (3, 1, 4, 1) is (f(4, 3) = 4). The beauty of the array (3, 1, 4, 1, 5) is (f(4, 5) = 5).

Tutorials

Codeforces Round 1026 (Div. 2) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
321147159 og.kostya F May 24, 2025, 5:21 p.m. OK C# 10 TESTS 23 327 15155200
321142159 uwu12 F May 24, 2025, 4:32 p.m. OK C# 10 TESTS 23 468 126361600
321173710 AminAnv1 F May 24, 2025, 11:02 p.m. OK C++17 (GCC 7-32) TESTS 23 359 4096000
321185452 ywjylx F May 25, 2025, 2:36 a.m. OK C++17 (GCC 7-32) TESTS 23 374 4096000
321184703 wujijlc F May 25, 2025, 2:20 a.m. OK C++17 (GCC 7-32) TESTS 23 374 4403200
321172747 AlexArdelean F May 24, 2025, 10:27 p.m. OK C++17 (GCC 7-32) TESTS 23 375 4300800
321172187 Roll_Num_44 F May 24, 2025, 10:09 p.m. OK C++17 (GCC 7-32) TESTS 23 389 307200
321172668 AlexArdelean F May 24, 2025, 10:24 p.m. OK C++17 (GCC 7-32) TESTS 23 389 6656000
321155703 AksLolCoding F May 24, 2025, 6:18 p.m. OK C++17 (GCC 7-32) TESTS 23 390 307200
321148231 Axial-Tilted F May 24, 2025, 5:26 p.m. OK C++17 (GCC 7-32) TESTS 23 405 307200
321173463 farmerboy F May 24, 2025, 10:54 p.m. OK C++17 (GCC 7-32) TESTS 23 405 4096000
321195746 gentlecoder29 F May 25, 2025, 5:12 a.m. OK C++17 (GCC 7-32) TESTS 23 405 6656000
321183810 ja1u0va F May 25, 2025, 1:58 a.m. OK C++20 (GCC 13-64) TESTS 23 280 409600
321155275 Fysty F May 24, 2025, 6:15 p.m. OK C++20 (GCC 13-64) TESTS 23 280 4096000
321198123 BerSerKeR07 F May 25, 2025, 5:38 a.m. OK C++20 (GCC 13-64) TESTS 23 281 307200
321197344 zhensama-- F May 25, 2025, 5:30 a.m. OK C++20 (GCC 13-64) TESTS 23 281 307200
321189939 ramswrooprathi F May 25, 2025, 3:53 a.m. OK C++20 (GCC 13-64) TESTS 23 281 307200
321173084 MrPerson F May 24, 2025, 10:40 p.m. OK C++20 (GCC 13-64) TESTS 23 281 307200
321189130 MintCat F May 25, 2025, 3:40 a.m. OK C++20 (GCC 13-64) TESTS 23 281 409600
321150057 Inkyo F May 24, 2025, 5:36 p.m. OK C++20 (GCC 13-64) TESTS 23 281 409600
321149036 -1e11 F May 24, 2025, 5:30 p.m. OK C++20 (GCC 13-64) TESTS 23 281 4096000
321148297 Coder-Osman F May 24, 2025, 5:26 p.m. OK C++20 (GCC 13-64) TESTS 23 281 4096000
321172919 AlexArdelean F May 24, 2025, 10:33 p.m. OK C++23 (GCC 14-64, msys2) TESTS 23 124 6451200
321173086 AlexArdelean F May 24, 2025, 10:40 p.m. OK C++23 (GCC 14-64, msys2) TESTS 23 140 2457600
321173526 AlexArdelean F May 24, 2025, 10:56 p.m. OK C++23 (GCC 14-64, msys2) TESTS 23 140 6144000
321173344 AlexArdelean F May 24, 2025, 10:50 p.m. OK C++23 (GCC 14-64, msys2) TESTS 23 140 6144000
321173316 AlexArdelean F May 24, 2025, 10:48 p.m. OK C++23 (GCC 14-64, msys2) TESTS 23 140 6144000
321162883 mychecksdead F May 24, 2025, 7:29 p.m. OK C++23 (GCC 14-64, msys2) TESTS 23 171 12595200
321175626 LoKl F May 25, 2025, 12:13 a.m. OK C++23 (GCC 14-64, msys2) TESTS 23 265 409600
321172787 AlexArdelean F May 24, 2025, 10:28 p.m. OK C++23 (GCC 14-64, msys2) TESTS 23 265 4403200
321196698 DQ1275 F May 25, 2025, 5:22 a.m. OK C++23 (GCC 14-64, msys2) TESTS 23 280 409600
321169414 igoroogle F May 24, 2025, 9:02 p.m. OK C++23 (GCC 14-64, msys2) TESTS 23 281 512000
321141206 cosmic_child F May 24, 2025, 4:30 p.m. OK PyPy 3-64 TESTS 23 609 144076800
321164133 x3mka F May 24, 2025, 7:43 p.m. OK PyPy 3-64 TESTS 23 687 142028800
321173728 Meitnera1n F May 24, 2025, 11:03 p.m. OK PyPy 3-64 TESTS 23 687 155852800
321154369 date_2.0 F May 24, 2025, 6:08 p.m. OK PyPy 3-64 TESTS 23 717 137625600
321150355 sushmanth.dampur8780 F May 24, 2025, 5:38 p.m. OK PyPy 3-64 TESTS 23 717 140390400
321157815 date_2.0 F May 24, 2025, 6:37 p.m. OK PyPy 3-64 TESTS 23 749 137625600
321139469 Devtripathi_codewizard F May 24, 2025, 4:27 p.m. OK Python 3 TESTS 23 1546 206028800
321142140 morshaline_1 F May 24, 2025, 4:32 p.m. OK Python 3 TESTS 23 1562 134963200
321155971 Ming_Xu F May 24, 2025, 6:20 p.m. OK Rust 2021 TESTS 23 296 85504000

remove filters

Back to search problems