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 |
---|---|---|---|---|---|---|
1656 | CodeTON Round 1 (Div. 1 + Div. 2, Rated, Prizes!) | FINISHED | False | 7200 | 89047463 | March 24, 2022, 2:35 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 598 ) | H | Equal LCM Subsets | PROGRAMMING | math number theory |
B'You are given two sets of positive integers A and B . You have to find two non-empty subsets S_A subseteq A , S_B subseteq B so that the least common multiple (LCM) of the elements of S_A is equal to the least common multiple (LCM) of the elements of S_B . The input consists of multiple test cases. The first line of the input contains one integer t ( 1 <= q t <= q 200 ), the number of test cases. For each test case, there is one line containing two integers n, m ( 1 <= q n, m <= q 1000 ), the sizes of the sets A and B , respectively. The next line contains n distinct integers a_1, a_2, ldots, a_n ( 1 <= q a_i <= q 4 cdot 10^{36} ), the elements of A . The next line contains m distinct integers b_1, b_2, ldots, b_m ( 1 <= q b_i <= q 4 cdot 10^{36} ), the elements of B . The sum of n for all test cases and the sum of m for all test cases is at most 1000 . For each test case, if there do not exist two subsets with equal least common multiple, output one line with NO. Otherwise, output one line with YES, followed by a line with two integers |S_A|, |S_B| ( 1 <= q |S_A| <= q n , 1 <= q |S_B| <= q m ), the sizes of the subsets S_A and S_B The next line should contain |S_A| integers x_1, x_2, ldots, x_{|S_A|} , the elements of S_A , followed by a line with |S_B| integers y_1, y_2, ldots, y_{|S_B|} , the elements of S_B . If there are multiple possible pairs of subsets, you can print any. '... |
Tutorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
150835814 | slime | H | March 24, 2022, 11:45 p.m. | OK | GNU C++17 (64) | TESTS | 21 | 670 | 257945600 | ||
150835748 | slime | H | March 24, 2022, 11:43 p.m. | OK | GNU C++17 (64) | TESTS | 21 | 920 | 257945600 | ||
150835404 | slime | H | March 24, 2022, 11:33 p.m. | OK | GNU C++17 (64) | TESTS | 21 | 920 | 257945600 | ||
150835788 | slime | H | March 24, 2022, 11:44 p.m. | OK | GNU C++17 (64) | TESTS | 21 | 935 | 257945600 | ||
150835565 | slime | H | March 24, 2022, 11:38 p.m. | OK | GNU C++17 (64) | TESTS | 21 | 1060 | 257945600 | ||
150835202 | slime | H | March 24, 2022, 11:26 p.m. | OK | GNU C++17 (64) | TESTS | 21 | 1996 | 257945600 | ||
150835140 | slime | H | March 24, 2022, 11:24 p.m. | OK | GNU C++17 (64) | TESTS | 21 | 2012 | 257945600 | ||
150835295 | slime | H | March 24, 2022, 11:29 p.m. | OK | GNU C++17 (64) | TESTS | 21 | 2058 | 257945600 | ||
150836078 | stevenkplus | H | March 24, 2022, 11:54 p.m. | OK | GNU C++17 (64) | TESTS | 21 | 2090 | 83660800 | ||
150800076 | zh0ukangyang | H | March 24, 2022, 4:28 p.m. | OK | GNU C++17 (64) | TESTS | 21 | 2479 | 57036800 | ||
150834092 | kiwikiwi | H | March 24, 2022, 10:49 p.m. | OK | GNU C++20 (64) | TESTS | 21 | 1840 | 39628800 | ||
150832265 | Zhukov_Dmitry | H | March 24, 2022, 9:58 p.m. | OK | GNU C++20 (64) | TESTS | 21 | 1981 | 11878400 | ||
150821235 | maroonrk | H | March 24, 2022, 6:58 p.m. | OK | GNU C++20 (64) | TESTS | 21 | 2012 | 66150400 | ||
150811903 | Raihanulislam12s | H | March 24, 2022, 5:38 p.m. | OK | GNU C++20 (64) | TESTS | 21 | 2012 | 80179200 | ||
150836239 | ecnerwala | H | March 24, 2022, 11:59 p.m. | OK | GNU C++20 (64) | TESTS | 21 | 2043 | 80179200 | ||
150833898 | kiwikiwi | H | March 24, 2022, 10:43 p.m. | OK | GNU C++20 (64) | TESTS | 21 | 2418 | 17920000 | ||
150839116 | Bellalabella | H | March 25, 2022, 1:21 a.m. | OK | GNU C++20 (64) | TESTS | 21 | 2948 | 162099200 | ||
150824529 | Vercingetorix | H | March 24, 2022, 7:36 p.m. | OK | GNU C++20 (64) | TESTS | 21 | 2963 | 144588800 | ||
150838260 | Alan233 | H | March 25, 2022, 12:58 a.m. | OK | GNU C++20 (64) | TESTS | 21 | 4726 | 129536000 | ||
150815569 | brunovsky | H | March 24, 2022, 6:06 p.m. | OK | GNU C++20 (64) | TESTS | 21 | 4913 | 66048000 | ||
150815430 | sansen | H | March 24, 2022, 6:04 p.m. | OK | Rust 2021 | TESTS | 21 | 3697 | 66150400 |
Back to search problems