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 |
---|---|---|---|---|---|---|
1975 | Codeforces Round 947 (Div. 1 + Div. 2) | FINISHED | False | 10800 | 15175499 | May 25, 2024, 2:35 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 17871 ) | B | 378QAQ and Mocha's Array | PROGRAMMING | brute force greedy math sortings | 1000 |
B'Mocha likes arrays, so before her departure, 378QAQ gave her an array a consisting of n positive integers as a gift. Mocha thinks that a is beautiful if there exist two numbers i and j ( 1 <= q i,j <= q n , i neq j ) such that for all k ( 1 <= q k <= q n ), a_k is divisible ^ dagger by either a_i or a_j . Determine whether a is beautiful. ^ dagger x is divisible by y if there exists an integer z such that x = y cdot z . Each test contains multiple test cases. The first line contains the number of test cases t ( 1 <= q t <= q 500 ). The description of the test cases follows. The first line of each test case contains a single integer n ( 3 <= q n <= q 10^5 ) -- the length of the array a . The second line of each test case contains n integers a_1,a_2, ldots,a_n ( 1 <= q a_i <= q 10^9 ) -- the elements of the array a . It is guaranteed that the sum of n over all test cases does not exceed 10^5 . For each test case, output "Yes" if array a is beautiful, and output "No" otherwise. You can output "Yes" and "No" in any case (for example, strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive response). In the first test case, any two numbers in the array are coprime, so the answer is "No". In the second test case, we can pick i=2 and j=1 . Since every number in the array is divisible by a_i = 1 , the answer is "Yes". In the third test case, we can pick i=3 and j=5 . 2 and 4 is divisible by a_i = 2 while 3 , 6 and 12 is divisible by a_j = 3 , so the answer is "Yes". '... |
editorial_zh.pdf |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
262807510 | YoussefAmr | B | May 26, 2024, 11:06 p.m. | OK | C# 10 | TESTS | 42 | 109 | 9420800 | 1000 | |
263107070 | mar1g | B | May 29, 2024, 7:55 a.m. | OK | C# 10 | TESTS | 42 | 140 | 9216000 | 1000 | |
263670033 | _all4n_ | B | June 1, 2024, 6:27 p.m. | OK | C++14 (GCC 6-32) | TESTS | 42 | 77 | 0 | 1000 | |
263669713 | _all4n_ | B | June 1, 2024, 6:24 p.m. | OK | C++14 (GCC 6-32) | TESTS | 42 | 77 | 0 | 1000 | |
263130320 | Faisal_Zaman | B | May 29, 2024, 11:07 a.m. | OK | C++14 (GCC 6-32) | TESTS | 42 | 77 | 0 | 1000 | |
263084023 | Jalendra_123 | B | May 29, 2024, 4:07 a.m. | OK | C++14 (GCC 6-32) | TESTS | 42 | 77 | 0 | 1000 | |
262935573 | that_geeky_guy | B | May 27, 2024, 9:34 p.m. | OK | C++14 (GCC 6-32) | TESTS | 42 | 77 | 0 | 1000 | |
262992485 | yyrwlj | B | May 28, 2024, 10:05 a.m. | OK | C++14 (GCC 6-32) | TESTS | 42 | 77 | 409600 | 1000 | |
262838708 | Grammar_hbw | B | May 27, 2024, 6:56 a.m. | OK | C++14 (GCC 6-32) | TESTS | 42 | 77 | 409600 | 1000 | |
262795268 | rafael2005 | B | May 26, 2024, 7:26 p.m. | OK | C++14 (GCC 6-32) | TESTS | 42 | 77 | 819200 | 1000 | |
263121411 | luogu_bot4 | B | May 29, 2024, 9:50 a.m. | OK | C++14 (GCC 6-32) | TESTS | 42 | 78 | 0 | 1000 | |
262899400 | gcc. | B | May 27, 2024, 3:04 p.m. | OK | C++14 (GCC 6-32) | TESTS | 42 | 78 | 0 | 1000 | |
262930150 | mayawan | B | May 27, 2024, 8:02 p.m. | OK | C++17 (GCC 7-32) | TESTS | 42 | 62 | 0 | 1000 | |
263629820 | Rares_Stan | B | June 1, 2024, 12:37 p.m. | OK | C++17 (GCC 7-32) | TESTS | 42 | 62 | 409600 | 1000 | |
262813406 | 200319200220 | B | May 27, 2024, 1:56 a.m. | OK | C++17 (GCC 7-32) | TESTS | 42 | 62 | 409600 | 1000 | |
263702609 | djs100201 | B | June 2, 2024, 5:27 a.m. | OK | C++17 (GCC 7-32) | TESTS | 42 | 77 | 0 | 1000 | |
263679975 | Piri.Piri | B | June 1, 2024, 8:41 p.m. | OK | C++17 (GCC 7-32) | TESTS | 42 | 77 | 0 | 1000 | |
263669156 | Nazmul101001000 | B | June 1, 2024, 6:19 p.m. | OK | C++17 (GCC 7-32) | TESTS | 42 | 77 | 0 | 1000 | |
263639109 | adipun | B | June 1, 2024, 1:59 p.m. | OK | C++17 (GCC 7-32) | TESTS | 42 | 77 | 0 | 1000 | |
263637753 | party04 | B | June 1, 2024, 1:47 p.m. | OK | C++17 (GCC 7-32) | TESTS | 42 | 77 | 0 | 1000 | |
263634946 | Rahuldeb5 naowalr | B | June 1, 2024, 1:23 p.m. | OK | C++17 (GCC 7-32) | TESTS | 42 | 77 | 0 | 1000 | |
263617458 | 800solver | B | June 1, 2024, 11 a.m. | OK | C++17 (GCC 7-32) | TESTS | 42 | 77 | 0 | 1000 | |
262966440 | Phobos_ | B | May 28, 2024, 6:19 a.m. | OK | C++20 (GCC 13-64) | TESTS | 42 | 62 | 0 | 1000 | |
262965886 | argtarg | B | May 28, 2024, 6:14 a.m. | OK | C++20 (GCC 13-64) | TESTS | 42 | 62 | 0 | 1000 | |
262951036 | cfqifei | B | May 28, 2024, 3:29 a.m. | OK | C++20 (GCC 13-64) | TESTS | 42 | 62 | 0 | 1000 | |
262946456 | luis01qs | B | May 28, 2024, 2:12 a.m. | OK | C++20 (GCC 13-64) | TESTS | 42 | 62 | 0 | 1000 | |
262938243 | Qwerty1412 | B | May 27, 2024, 10:35 p.m. | OK | C++20 (GCC 13-64) | TESTS | 42 | 62 | 0 | 1000 | |
262836959 | Md_Abu_Taleb | B | May 27, 2024, 6:43 a.m. | OK | C++20 (GCC 13-64) | TESTS | 42 | 62 | 0 | 1000 | |
262833866 | hridyansh289 | B | May 27, 2024, 6:13 a.m. | OK | C++20 (GCC 13-64) | TESTS | 42 | 62 | 0 | 1000 | |
262823405 | qwqIdontHaveAgf | B | May 27, 2024, 4:45 a.m. | OK | C++20 (GCC 13-64) | TESTS | 42 | 62 | 0 | 1000 | |
263568927 | dhyey24_ | B | June 1, 2024, 3:37 a.m. | OK | C++20 (GCC 13-64) | TESTS | 42 | 62 | 102400 | 1000 | |
263416362 | shreedhar1 | B | May 31, 2024, 5:43 a.m. | OK | C++20 (GCC 13-64) | TESTS | 42 | 62 | 102400 | 1000 | |
263606807 | attractors | B | June 1, 2024, 9:32 a.m. | OK | GNU C11 | TESTS | 42 | 77 | 512000 | 1000 | |
262914028 | statucci | B | May 27, 2024, 5:08 p.m. | OK | GNU C11 | TESTS | 42 | 77 | 921600 | 1000 | |
262868272 | naman_hehe | B | May 27, 2024, 11:01 a.m. | OK | GNU C11 | TESTS | 42 | 93 | 819200 | 1000 | |
263166207 | I_need_7.0_IELTS | B | May 29, 2024, 4:04 p.m. | OK | GNU C11 | TESTS | 42 | 93 | 921600 | 1000 | |
263246729 | nguyenquocthao00 | B | May 30, 2024, 12:24 p.m. | OK | Go | TESTS | 42 | 78 | 5120000 | 1000 | |
262918400 | nabil_salah | B | May 27, 2024, 5:49 p.m. | OK | Go | TESTS | 42 | 109 | 2457600 | 1000 | |
262850829 | Tobo | B | May 27, 2024, 8:31 a.m. | OK | Go | TESTS | 42 | 109 | 5529600 | 1000 | |
263634812 | yashmishra.vapi | B | June 1, 2024, 1:22 p.m. | OK | Java 21 | TESTS | 42 | 311 | 716800 | 1000 | |
263018037 | shiguang12318 | B | May 28, 2024, 1:31 p.m. | OK | Java 21 | TESTS | 42 | 312 | 614400 | 1000 | |
262805110 | AkshatSaxena_05 | B | May 26, 2024, 10:03 p.m. | OK | Java 21 | TESTS | 42 | 312 | 819200 | 1000 | |
262859700 | Freedom_lifelong | B | May 27, 2024, 9:48 a.m. | OK | Java 21 | TESTS | 42 | 312 | 4505600 | 1000 | |
262974577 | dzhi | B | May 28, 2024, 7:30 a.m. | OK | Java 21 | TESTS | 42 | 327 | 614400 | 1000 | |
262939650 | mangos194 | B | May 27, 2024, 11:20 p.m. | OK | Java 21 | TESTS | 42 | 327 | 921600 | 1000 | |
262802503 | SD125 | B | May 26, 2024, 9:09 p.m. | OK | Java 21 | TESTS | 42 | 327 | 921600 | 1000 | |
263050096 | Omar_Morsi | B | May 28, 2024, 6 p.m. | OK | Java 21 | TESTS | 42 | 327 | 1433600 | 1000 | |
263554223 | harsh_chib70 | B | May 31, 2024, 10:22 p.m. | OK | Java 21 | TESTS | 42 | 327 | 7168000 | 1000 | |
262814181 | ChongQY | B | May 27, 2024, 2:14 a.m. | OK | Java 21 | TESTS | 42 | 327 | 8704000 | 1000 | |
263586549 | harsh_1806 | B | June 1, 2024, 6:46 a.m. | OK | Java 8 | TESTS | 42 | 171 | 0 | 1000 | |
263228380 | 1091857051 | B | May 30, 2024, 11:16 a.m. | OK | Java 8 | TESTS | 42 | 186 | 2560000 | 1000 | |
262831422 | y_a_s | B | May 27, 2024, 5:45 a.m. | OK | Java 8 | TESTS | 42 | 202 | 2560000 | 1000 | |
262849389 | wat2 | B | May 27, 2024, 8:19 a.m. | OK | Java 8 | TESTS | 42 | 203 | 12288000 | 1000 | |
262817093 | yvbf | B | May 27, 2024, 3:08 a.m. | OK | Java 8 | TESTS | 42 | 218 | 0 | 1000 | |
263046629 | UniversalAdmin | B | May 28, 2024, 5:29 p.m. | OK | Java 8 | TESTS | 42 | 265 | 3788800 | 1000 | |
262739007 | AgniWarrior | B | May 26, 2024, 2:52 p.m. | OK | Java 8 | TESTS | 42 | 280 | 5836800 | 1000 | |
262787867 | Insiderr | B | May 26, 2024, 6:01 p.m. | OK | Java 8 | TESTS | 42 | 296 | 0 | 1000 | |
263007208 | RenukaMV | B | May 28, 2024, 12:07 p.m. | OK | Java 8 | TESTS | 42 | 312 | 0 | 1000 | |
263543278 | AshekMishra | B | May 31, 2024, 7:11 p.m. | OK | Java 8 | TESTS | 42 | 327 | 0 | 1000 | |
262971969 | nealzane | B | May 28, 2024, 7:08 a.m. | OK | PyPy 3 | TESTS | 42 | 264 | 12185600 | 1000 | |
262863575 | xxx.ego | B | May 27, 2024, 10:23 a.m. | OK | PyPy 3 | TESTS | 42 | 281 | 10752000 | 1000 | |
263016316 | AI_ | B | May 28, 2024, 1:18 p.m. | OK | PyPy 3-64 | TESTS | 42 | 124 | 13619200 | 1000 | |
263103394 | JackQin | B | May 29, 2024, 7:27 a.m. | OK | PyPy 3-64 | TESTS | 42 | 124 | 13926400 | 1000 | |
262899190 | AndreiZherder | B | May 27, 2024, 3:02 p.m. | OK | PyPy 3-64 | TESTS | 42 | 124 | 15257600 | 1000 | |
262854370 | acorn11 | B | May 27, 2024, 9:02 a.m. | OK | PyPy 3-64 | TESTS | 42 | 124 | 18329600 | 1000 | |
262779459 | taliansky | B | May 26, 2024, 4:36 p.m. | OK | PyPy 3-64 | TESTS | 42 | 125 | 15257600 | 1000 | |
263037995 | victorrschmidt | B | May 28, 2024, 4:12 p.m. | OK | PyPy 3-64 | TESTS | 42 | 139 | 12288000 | 1000 | |
262786677 | abobus_check | B | May 26, 2024, 5:49 p.m. | OK | PyPy 3-64 | TESTS | 42 | 139 | 13516800 | 1000 | |
262713414 | jgs03177 | B | May 26, 2024, 1:58 p.m. | OK | PyPy 3-64 | TESTS | 42 | 139 | 18944000 | 1000 | |
263061978 | sohampalkar | B | May 28, 2024, 8:14 p.m. | OK | PyPy 3-64 | TESTS | 42 | 140 | 12800000 | 1000 | |
262712815 | M_M_MOMIN | B | May 26, 2024, 1:53 p.m. | OK | PyPy 3-64 | TESTS | 42 | 140 | 13619200 | 1000 | |
262820676 | klu2100031976 | B | May 27, 2024, 4:05 a.m. | OK | Python 3 | TESTS | 42 | 109 | 15052800 | 1000 | |
262923837 | abo_shanab | B | May 27, 2024, 6:43 p.m. | OK | Python 3 | TESTS | 42 | 124 | 13312000 | 1000 | |
263130336 | atharva_112 | B | May 29, 2024, 11:07 a.m. | OK | Python 3 | TESTS | 42 | 124 | 14028800 | 1000 | |
262954623 | hanamoin0909 | B | May 28, 2024, 4:21 a.m. | OK | Python 3 | TESTS | 42 | 124 | 14950400 | 1000 | |
262798656 | 2210080018 | B | May 26, 2024, 8:11 p.m. | OK | Python 3 | TESTS | 42 | 124 | 15052800 | 1000 | |
263648602 | Jawad_Khan | B | June 1, 2024, 3:22 p.m. | OK | Python 3 | TESTS | 42 | 124 | 15462400 | 1000 | |
263009012 | asiftreadingonthinice | B | May 28, 2024, 12:21 p.m. | OK | Python 3 | TESTS | 42 | 139 | 13926400 | 1000 | |
263556892 | AYMEN.N.C | B | May 31, 2024, 11:35 p.m. | OK | Python 3 | TESTS | 42 | 139 | 14028800 | 1000 | |
263701723 | beginner_Ayush | B | June 2, 2024, 5:16 a.m. | OK | Python 3 | TESTS | 42 | 140 | 13516800 | 1000 | |
262855724 | lqtrung1998 | B | May 27, 2024, 9:14 a.m. | OK | Python 3 | TESTS | 42 | 140 | 13619200 | 1000 | |
263566434 | n0b0dy01 | B | June 1, 2024, 3:02 a.m. | OK | Rust 2021 | TESTS | 42 | 62 | 0 | 1000 | |
263108635 | BetterThanNobita | B | May 29, 2024, 8:07 a.m. | OK | Rust 2021 | TESTS | 42 | 77 | 0 | 1000 | |
263051055 | Maksim1744 | B | May 28, 2024, 6:08 p.m. | OK | Rust 2021 | TESTS | 42 | 77 | 0 | 1000 | |
262869062 | kshitij | B | May 27, 2024, 11:08 a.m. | OK | Rust 2021 | TESTS | 42 | 77 | 5939200 | 1000 |
Back to search problems