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 |
---|---|---|---|---|---|---|
1737 | Dytechlab Cup 2022 | FINISHED | False | 9000 | 66669899 | Oct. 7, 2022, 2:35 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 125 ) | F | Ela and Prime GCD | PROGRAMMING | constructive algorithms math number theory |
B'After a long, tough, but fruitful day at DTL, Ela goes home happily. She entertains herself by solving Competitive Programming problems. She prefers short statements, because she already read too many long papers and documentation at work. The problem of the day reads: You are given an integer c . Suppose that c has n divisors. You have to find a sequence with n - 1 integers [a_1, a_2, ... a_{n - 1}] , which satisfies the following conditions: In this problem, because c can be too big, the result of prime factorization of c is given instead. Note that gcd(x, y) denotes the greatest common divisor (GCD) of integers x and y and a prime number is a positive integer which has exactly 2 divisors. The first line contains one integer t ( 1 <= t <= 10^4 ) - the number of test cases. The first line of each test case contains one integer m ( 1 <= m <= 16 ) - the number of prime factor of c . The second line of each test case contains m integers b_1, b_2, ldots, b_m ( 1 <= b_i < 2^{20} ) -- exponents of corresponding prime factors of c , so that c = p_1^{b_1} cdot p_2^{b_2} cdot ldots cdot p_m^{b_m} and n = (b_1 + 1)(b_2 + 1) ldots (b_m + 1) hold. p_i is the i -th smallest prime number. It is guaranteed that the sum of n cdot m over all test cases does not exceed 2^{20} . Print the answer for each test case, one per line. If there is no sequence for the given c , print -1 . Otherwise, print n - 1 lines. In i -th line, print m space-separated integers. The j -th integer of i -th line is equal to the exponent of j -th prime number from a_i . If there are multiple answers, print any of them. In each test case, the values of c are 6 , 2 , 30 , 16 , and 12 in that order. In the first test case, 1 , 2 , 3 , 6 are diviso'... |
Editorial of Dytechlab Cup 2022 |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
175046032 | dmenezes | F | Oct. 7, 2022, 7:30 p.m. | OK | GNU C++17 | TESTS | 60 | 187 | 5836800 | ||
175040894 | jack112739 | F | Oct. 7, 2022, 6:36 p.m. | OK | GNU C++17 | TESTS | 60 | 187 | 14540800 | ||
175050500 | rainboy | F | Oct. 7, 2022, 8:24 p.m. | OK | GNU C++17 (64) | TESTS | 60 | 109 | 134348800 | ||
175046184 | Handsome2004 | F | Oct. 7, 2022, 7:32 p.m. | OK | GNU C++17 (64) | TESTS | 60 | 124 | 40857600 | ||
175048189 | 353cerega | F | Oct. 7, 2022, 7:55 p.m. | OK | GNU C++17 (64) | TESTS | 60 | 140 | 28774400 | ||
175041494 | Benq | F | Oct. 7, 2022, 6:42 p.m. | OK | GNU C++17 (64) | TESTS | 60 | 561 | 16486400 | ||
175028872 | Vercingetorix | F | Oct. 7, 2022, 5:03 p.m. | OK | GNU C++20 (64) | TESTS | 60 | 46 | 14028800 | ||
175017871 | tourist | F | Oct. 7, 2022, 4:22 p.m. | OK | GNU C++20 (64) | TESTS | 60 | 93 | 10240000 | ||
175029139 | heno239 | F | Oct. 7, 2022, 5:04 p.m. | OK | GNU C++20 (64) | TESTS | 60 | 108 | 19251200 | ||
175029017 | A_G | F | Oct. 7, 2022, 5:03 p.m. | OK | GNU C++20 (64) | TESTS | 60 | 124 | 20889600 | ||
175032650 | abc864197532 | F | Oct. 7, 2022, 5:32 p.m. | OK | GNU C++20 (64) | TESTS | 60 | 155 | 18227200 |
Back to search problems