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 |
---|---|---|---|---|---|---|
1934 | Codeforces Round 931 (Div. 2) | FINISHED | False | 7200 | 27876263 | March 1, 2024, 2:35 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 251 ) | E | Weird LCM Operations | PROGRAMMING | brute force constructive algorithms |
B'Given an integer n , you construct an array a of n integers, where a_i = i for all integers i in the range [1, n] . An operation on this array is defined as follows: After all the operations a_i <= 10^{18} should hold for all 1 <= i <= n . We can show that an answer always exists. The first line contains one integer t ( 1 <= t <= 10^2 ) -- the number of test cases. The description of the test cases follows. The first and only line of each test case contains an integer n ( 3 <= q n <= q 3 cdot 10^{4} ) -- the length of the array. It is guaranteed that the sum of n over all test cases does not exceed 3 cdot 10^{4} . The first line should contain an integer k ( 0 <= q k <= q lfloor frac{n}{6} rfloor + 5 ) -- where k is the number of operations. The next k lines should contain the description of each operation i.e. 3 integers i , j and k , where 1 <= q i, j, k <= q n and all must be distinct. In the third test case, a = [1, 2, 3, 4, 5, 6, 7] . First operation: i = 3 , j = 5 , k = 7 x = 3 , y = 5 , z = 7 . a = [1, 2, operatorname{lcm}(y,z), 4, operatorname{lcm}(x,z), 6, operatorname{lcm}(x,y)] = [1, 2, color{red}{35}, 4, color{red}{21}, 6, color{red}{15}] . Second operation: i = 5 , j = 6 , k = 7 x = 21 , y = 6 , z = 15 . a = [1, 2, 35, 4, operatorname{lcm}(y,z), operatorname{lcm}(x,z), operatorname{lcm}(x,y)] = [1, 2, 35, 4, color{red}{30}, color{red}{105}, color{red}{42}] . Third operation: i = 2 , j = 3 , k = 4 x = 2 , y = 35 , z = 4 . a = [1, operatorname{lcm}(y,z), operatorname{lcm}(x,z), operatorname{lcm}(x,y), 30, 105, 42] = [1, color{red}{140}, color{red}{4}, color{red}{70}, 30, 105, 42] . Subsequences whose GCD equal to i is as follows: gcd(a_1, a_2) = gcd'... |
Tutorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
249187490 | rainboy | E | March 1, 2024, 6:04 p.m. | OK | GNU C11 | TESTS | 73 | 46 | 307200 | ||
249181637 | rainboy | E | March 1, 2024, 5:32 p.m. | OK | GNU C11 | TESTS | 73 | 46 | 1126400 | ||
249180627 | rainboy | E | March 1, 2024, 5:27 p.m. | OK | GNU C11 | TESTS | 73 | 46 | 1126400 | ||
249201745 | Alan_Amin_futureGeniuses | E | March 1, 2024, 7:37 p.m. | OK | GNU C++17 | TESTS | 73 | 15 | 614400 | ||
249226917 | Hanghang007 | E | March 2, 2024, 1:33 a.m. | OK | GNU C++17 | TESTS | 73 | 31 | 0 | ||
249197167 | liympanda | E | March 1, 2024, 7:03 p.m. | OK | GNU C++17 | TESTS | 73 | 31 | 614400 | ||
249169878 | mickeyjung | E | March 1, 2024, 4:31 p.m. | OK | GNU C++17 | TESTS | 73 | 31 | 819200 | ||
249215850 | JAY19 | E | March 1, 2024, 9:55 p.m. | OK | GNU C++17 | TESTS | 73 | 31 | 4403200 | ||
249190323 | Heibor | E | March 1, 2024, 6:21 p.m. | OK | GNU C++17 (64) | TESTS | 73 | 15 | 102400 | ||
249200763 | kaiboy | E | March 1, 2024, 7:29 p.m. | OK | GNU C++20 (64) | TESTS | 73 | 15 | 0 | ||
249178685 | Yzm007 | E | March 1, 2024, 5:19 p.m. | OK | GNU C++20 (64) | TESTS | 73 | 15 | 204800 | ||
249231033 | sunkuangzheng | E | March 2, 2024, 2:42 a.m. | OK | GNU C++20 (64) | TESTS | 73 | 15 | 204800 | ||
249172547 | abc864197532 | E | March 1, 2024, 4:34 p.m. | OK | GNU C++20 (64) | TESTS | 73 | 15 | 204800 | ||
249229691 | sunkuangzheng | E | March 2, 2024, 2:21 a.m. | OK | GNU C++20 (64) | TESTS | 73 | 15 | 204800 | ||
249229670 | sunkuangzheng | E | March 2, 2024, 2:21 a.m. | OK | GNU C++20 (64) | TESTS | 73 | 15 | 204800 | ||
249177605 | femboy-wannabe | E | March 1, 2024, 5:15 p.m. | OK | GNU C++20 (64) | TESTS | 73 | 15 | 307200 | ||
249170673 | Sugar_fan | E | March 1, 2024, 4:32 p.m. | OK | GNU C++20 (64) | TESTS | 73 | 15 | 307200 | ||
249210258 | yangster67 | E | March 1, 2024, 8:51 p.m. | OK | GNU C++20 (64) | TESTS | 73 | 15 | 409600 | ||
249227033 | beiyuli | E | March 2, 2024, 1:35 a.m. | OK | GNU C++20 (64) | TESTS | 73 | 15 | 409600 | ||
249183477 | dishanth0282 | E | March 1, 2024, 5:41 p.m. | OK | PyPy 3-64 | TESTS | 73 | 186 | 8396800 | ||
249176945 | Little_Sheep_Yawn | E | March 1, 2024, 5:12 p.m. | OK | PyPy 3-64 | TESTS | 73 | 187 | 11468800 | ||
249213287 | htnhtn | E | March 1, 2024, 9:24 p.m. | OK | Python 3 | TESTS | 73 | 46 | 716800 | ||
249210435 | shade34 | E | March 1, 2024, 8:53 p.m. | OK | Python 3 | TESTS | 73 | 62 | 1024000 | ||
249204972 | htnhtn | E | March 1, 2024, 8:03 p.m. | OK | Python 3 | TESTS | 73 | 77 | 1024000 |
Back to search problems