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 |
---|---|---|---|---|---|---|
1535 | Educational Codeforces Round 110 (Rated for Div. 2) | FINISHED | False | 7200 | 114449063 | June 4, 2021, 2:35 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 31120 ) | B | Array Reodering | PROGRAMMING | brute force greedy math number theory sortings |
B"You are given an array a consisting of n integers. Let's call a pair of indices i , j good if 1 <= i < j <= n and gcd(a_i, 2a_j) > 1 (where gcd(x, y) is the greatest common divisor of x and y ). Find the maximum number of good index pairs if you can reorder the array a in an arbitrary way. The first line contains a single integer t ( 1 <= t <= 1000 ) -- the number of test cases. The first line of the test case contains a single integer n ( 2 <= n <= 2000 ) -- the number of elements in the array. The second line of the test case contains n integers a_1, a_2, ... , a_n ( 1 <= a_i <= 10^5 ). It is guaranteed that the sum of n over all test cases does not exceed 2000 . For each test case, output a single integer -- the maximum number of good index pairs if you can reorder the array a in an arbitrary way. In the first example, the array elements can be rearranged as follows: [6, 3, 5, 3] . In the third example, the array elements can be rearranged as follows: [4, 4, 2, 1, 1] . "... |
91481 |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
118450367 | SAKIB_ALAMIN | B | June 4, 2021, 6:22 p.m. | OK | Clang++17 Diagnostics | TESTS | 5 | 327 | 512000 | ||
118449361 | _aurthohin_ | B | June 4, 2021, 6:07 p.m. | OK | Clang++17 Diagnostics | TESTS | 5 | 342 | 512000 | ||
118452236 | LazyMediocre | B | June 4, 2021, 6:51 p.m. | OK | Clang++17 Diagnostics | TESTS | 5 | 343 | 512000 | ||
118449557 | _aurthohin_ | B | June 4, 2021, 6:10 p.m. | OK | Clang++17 Diagnostics | TESTS | 5 | 343 | 512000 | ||
118435292 | iquoteonyou | B | June 4, 2021, 4:24 p.m. | OK | GNU C11 | TESTS | 5 | 171 | 0 | ||
118437016 | iquoteonyou | B | June 4, 2021, 4:28 p.m. | OK | GNU C11 | TESTS | 5 | 171 | 0 | ||
118438409 | iquoteonyou | B | June 4, 2021, 4:32 p.m. | OK | GNU C11 | TESTS | 5 | 171 | 0 | ||
118466706 | milan_s1 | B | June 5, 2021, 3:17 a.m. | OK | GNU C11 | TESTS | 20 | 186 | 0 | ||
118466993 | anmol_22 | B | June 5, 2021, 3:25 a.m. | OK | GNU C11 | TESTS | 20 | 187 | 0 | ||
118464020 | Noman_Ahmmed | B | June 5, 2021, 2:04 a.m. | OK | GNU C11 | TESTS | 20 | 202 | 0 | ||
118454020 | murali_33 | B | June 4, 2021, 7:25 p.m. | OK | GNU C11 | TESTS | 20 | 234 | 0 | ||
118463964 | zs1762090072 | B | June 5, 2021, 2:01 a.m. | OK | GNU C11 | TESTS | 20 | 343 | 0 | ||
118438776 | Noman_Ahmmed | B | June 4, 2021, 4:33 p.m. | OK | GNU C11 | TESTS | 5 | 373 | 102400 | ||
118473414 | sai_prasanna | B | June 5, 2021, 5:36 a.m. | OK | GNU C11 | TESTS | 20 | 468 | 0 | ||
118443121 | Aarush.zxd | B | June 4, 2021, 4:57 p.m. | OK | GNU C++11 | TESTS | 5 | 46 | 409600 | ||
118474091 | realWarLord | B | June 5, 2021, 5:47 a.m. | OK | GNU C++11 | TESTS | 20 | 139 | 13312000 | ||
118443928 | Originator-kumma | B | June 4, 2021, 5:04 p.m. | OK | GNU C++11 | TESTS | 5 | 140 | 0 | ||
118437515 | o.H.o | B | June 4, 2021, 4:30 p.m. | OK | GNU C++11 | TESTS | 5 | 140 | 0 | ||
118435871 | paras.jain.cd.mec19 | B | June 4, 2021, 4:25 p.m. | OK | GNU C++11 | TESTS | 5 | 155 | 0 | ||
118452623 | kunal81198 | B | June 4, 2021, 6:58 p.m. | OK | GNU C++11 | TESTS | 5 | 155 | 0 | ||
118435791 | JerryLym | B | June 4, 2021, 4:25 p.m. | OK | GNU C++11 | TESTS | 5 | 155 | 409600 | ||
118451669 | SayanSahu | B | June 4, 2021, 6:42 p.m. | OK | GNU C++11 | TESTS | 5 | 156 | 0 | ||
118447788 | georgerapeanu | B | June 4, 2021, 5:46 p.m. | OK | GNU C++11 | TESTS | 5 | 156 | 0 | ||
118447421 | afzal_shorif | B | June 4, 2021, 5:42 p.m. | OK | GNU C++11 | TESTS | 5 | 156 | 0 | ||
118445660 | sonika_iitg | B | June 4, 2021, 5:21 p.m. | OK | GNU C++14 | TESTS | 5 | 46 | 307200 | ||
118445530 | vishwajeet7381 | B | June 4, 2021, 5:20 p.m. | OK | GNU C++14 | TESTS | 5 | 108 | 102400 | ||
118434205 | rahulsingh21247 | B | June 4, 2021, 4:20 p.m. | OK | GNU C++14 | TESTS | 5 | 124 | 102400 | ||
118442754 | unknownblueguy6 | B | June 4, 2021, 4:55 p.m. | OK | GNU C++14 | TESTS | 5 | 124 | 409600 | ||
118441193 | Akshat_25 | B | June 4, 2021, 4:44 p.m. | OK | GNU C++14 | TESTS | 5 | 139 | 102400 | ||
118443690 | tarangsharma1999 | B | June 4, 2021, 5:02 p.m. | OK | GNU C++14 | TESTS | 5 | 139 | 204800 | ||
118452844 | nishant_89 | B | June 4, 2021, 7:02 p.m. | OK | GNU C++14 | TESTS | 5 | 140 | 102400 | ||
118443967 | skate1512 | B | June 4, 2021, 5:05 p.m. | OK | GNU C++14 | TESTS | 5 | 140 | 102400 | ||
118452824 | nishant_89 | B | June 4, 2021, 7:01 p.m. | OK | GNU C++14 | TESTS | 5 | 140 | 102400 | ||
118451295 | shaad1133 | B | June 4, 2021, 6:36 p.m. | OK | GNU C++14 | TESTS | 5 | 140 | 102400 | ||
118435948 | Mainak1999 | B | June 4, 2021, 4:25 p.m. | OK | GNU C++17 | TESTS | 5 | 46 | 1331200 | ||
118441728 | fillleon | B | June 4, 2021, 4:47 p.m. | OK | GNU C++17 | TESTS | 5 | 77 | 204800 | ||
118436025 | Pious | B | June 4, 2021, 4:26 p.m. | OK | GNU C++17 | TESTS | 5 | 108 | 1638400 | ||
118442259 | 01aglupal | B | June 4, 2021, 4:51 p.m. | OK | GNU C++17 | TESTS | 5 | 109 | 102400 | ||
118435661 | xanmol_cf | B | June 4, 2021, 4:25 p.m. | OK | GNU C++17 | TESTS | 5 | 109 | 102400 | ||
118434376 | Swarnadeep5467 | B | June 4, 2021, 4:21 p.m. | OK | GNU C++17 | TESTS | 5 | 109 | 102400 | ||
118442454 | Shrishti_kumari | B | June 4, 2021, 4:52 p.m. | OK | GNU C++17 | TESTS | 5 | 124 | 102400 | ||
118445393 | final_Ride | B | June 4, 2021, 5:18 p.m. | OK | GNU C++17 | TESTS | 5 | 124 | 102400 | ||
118443724 | Selfish29 | B | June 4, 2021, 5:02 p.m. | OK | GNU C++17 | TESTS | 5 | 139 | 0 | ||
118445852 | anshjain | B | June 4, 2021, 5:23 p.m. | OK | GNU C++17 | TESTS | 5 | 139 | 102400 | ||
118452636 | EVTrainer | B | June 4, 2021, 6:59 p.m. | OK | GNU C++17 (64) | TESTS | 5 | 124 | 0 | ||
118442393 | DreamingLeaf | B | June 4, 2021, 4:52 p.m. | OK | GNU C++17 (64) | TESTS | 5 | 139 | 0 | ||
118443821 | Reeman | B | June 4, 2021, 5:03 p.m. | OK | GNU C++17 (64) | TESTS | 5 | 139 | 0 | ||
118434938 | Harsh20Ag | B | June 4, 2021, 4:22 p.m. | OK | GNU C++17 (64) | TESTS | 5 | 140 | 0 | ||
118443849 | chendeyu | B | June 4, 2021, 5:03 p.m. | OK | GNU C++17 (64) | TESTS | 5 | 140 | 0 | ||
118453132 | _fire_fly_ | B | June 4, 2021, 7:07 p.m. | OK | GNU C++17 (64) | TESTS | 5 | 155 | 0 | ||
118444934 | abhishek7997 | B | June 4, 2021, 5:13 p.m. | OK | GNU C++17 (64) | TESTS | 5 | 155 | 0 | ||
118448639 | Mihnea_Info | B | June 4, 2021, 5:58 p.m. | OK | GNU C++17 (64) | TESTS | 5 | 156 | 0 | ||
118450070 | JovanB | B | June 4, 2021, 6:18 p.m. | OK | GNU C++17 (64) | TESTS | 5 | 156 | 0 | ||
118451343 | __Nobody__ | B | June 4, 2021, 6:37 p.m. | OK | GNU C++17 (64) | TESTS | 5 | 156 | 0 | ||
118445792 | arnab__07 | B | June 4, 2021, 5:23 p.m. | OK | Java 11 | TESTS | 5 | 295 | 0 | ||
118443442 | tsaraf | B | June 4, 2021, 5 p.m. | OK | Java 11 | TESTS | 5 | 311 | 0 | ||
118443694 | Aman_dixit | B | June 4, 2021, 5:02 p.m. | OK | Java 11 | TESTS | 5 | 311 | 0 | ||
118444634 | tarungupta1 | B | June 4, 2021, 5:10 p.m. | OK | Java 11 | TESTS | 5 | 327 | 0 | ||
118442525 | ypa | B | June 4, 2021, 4:53 p.m. | OK | Java 11 | TESTS | 5 | 327 | 0 | ||
118447374 | ryanranaut | B | June 4, 2021, 5:41 p.m. | OK | Java 11 | TESTS | 5 | 342 | 0 | ||
118433453 | sdgik | B | June 4, 2021, 4:18 p.m. | OK | Java 11 | TESTS | 5 | 342 | 0 | ||
118450445 | Yuxiang | B | June 4, 2021, 6:23 p.m. | OK | Java 11 | TESTS | 5 | 343 | 0 | ||
118443609 | athakre1962000 | B | June 4, 2021, 5:02 p.m. | OK | Java 11 | TESTS | 5 | 343 | 0 | ||
118447907 | nirvana_rsc | B | June 4, 2021, 5:48 p.m. | OK | Java 11 | TESTS | 5 | 343 | 0 | ||
118455696 | Sandip_Jana | B | June 4, 2021, 7:54 p.m. | OK | Java 8 | TESTS | 20 | 249 | 0 | ||
118438448 | bruce_waynes | B | June 4, 2021, 4:32 p.m. | OK | Java 8 | TESTS | 5 | 264 | 0 | ||
118442235 | prezesstefan | B | June 4, 2021, 4:51 p.m. | OK | Java 8 | TESTS | 5 | 265 | 0 | ||
118445580 | coder_terror | B | June 4, 2021, 5:20 p.m. | OK | Java 8 | TESTS | 5 | 265 | 0 | ||
118463631 | SainiAayush | B | June 5, 2021, 1:48 a.m. | OK | Java 8 | TESTS | 20 | 265 | 0 | ||
118450205 | RonWonWon | B | June 4, 2021, 6:20 p.m. | OK | Java 8 | TESTS | 5 | 280 | 0 | ||
118443168 | balkrishnaagrawal007 | B | June 4, 2021, 4:58 p.m. | OK | Java 8 | TESTS | 5 | 280 | 0 | ||
118443226 | ashuman231 | B | June 4, 2021, 4:58 p.m. | OK | Java 8 | TESTS | 5 | 280 | 0 | ||
118450214 | Sandip_Jana | B | June 4, 2021, 6:20 p.m. | OK | Java 8 | TESTS | 5 | 280 | 0 | ||
118444204 | Gupta-OP | B | June 4, 2021, 5:07 p.m. | OK | Java 8 | TESTS | 5 | 280 | 0 | ||
118458797 | Potassium | B | June 4, 2021, 9:27 p.m. | OK | Kotlin | TESTS | 20 | 374 | 409600 | ||
118438573 | ravi_prakash_28 | B | June 4, 2021, 4:32 p.m. | OK | MS C++ | TESTS | 5 | 156 | 0 | ||
118441872 | Codingmyworld | B | June 4, 2021, 4:48 p.m. | OK | MS C++ | TESTS | 5 | 624 | 0 | ||
118445080 | Ilyaiq300 | B | June 4, 2021, 5:15 p.m. | OK | MS C++ 2017 | TESTS | 5 | 155 | 0 | ||
118436469 | AmalSN | B | June 4, 2021, 4:27 p.m. | OK | MS C++ 2017 | TESTS | 5 | 156 | 0 | ||
118437160 | kritias | B | June 4, 2021, 4:29 p.m. | OK | MS C++ 2017 | TESTS | 5 | 171 | 0 | ||
118433951 | df1120 | B | June 4, 2021, 4:20 p.m. | OK | MS C++ 2017 | TESTS | 5 | 186 | 0 | ||
118437119 | korchatao | B | June 4, 2021, 4:29 p.m. | OK | MS C++ 2017 | TESTS | 5 | 186 | 0 | ||
118436630 | xiaohonghua | B | June 4, 2021, 4:27 p.m. | OK | MS C++ 2017 | TESTS | 5 | 187 | 102400 | ||
118456432 | sharmahimanshu65018 | B | June 4, 2021, 8:12 p.m. | OK | MS C++ 2017 | TESTS | 20 | 217 | 0 | ||
118469079 | Ke1 | B | June 5, 2021, 4:16 a.m. | OK | MS C++ 2017 | TESTS | 20 | 218 | 0 | ||
118434163 | jianrong2215 | B | June 4, 2021, 4:20 p.m. | OK | MS C++ 2017 | TESTS | 5 | 218 | 0 | ||
118467290 | Santeru | B | June 5, 2021, 3:32 a.m. | OK | MS C++ 2017 | TESTS | 20 | 218 | 0 | ||
118436116 | ansergeyg | B | June 4, 2021, 4:26 p.m. | OK | .NET Core C# | TESTS | 5 | 264 | 716800 | ||
118468023 | net93k | B | June 5, 2021, 3:51 a.m. | OK | .NET Core C# | TESTS | 20 | 296 | 1638400 | ||
118453885 | MinorMiracle | B | June 4, 2021, 7:22 p.m. | OK | .NET Core C# | TESTS | 20 | 358 | 614400 | ||
118451985 | nsp3333 | B | June 4, 2021, 6:47 p.m. | OK | PyPy 3 | TESTS | 5 | 264 | 1945600 | ||
118452055 | shiv_17 | B | June 4, 2021, 6:48 p.m. | OK | PyPy 3 | TESTS | 5 | 280 | 1843200 | ||
118451609 | SM16 | B | June 4, 2021, 6:41 p.m. | OK | PyPy 3 | TESTS | 5 | 280 | 1843200 | ||
118439512 | leco10 | B | June 4, 2021, 4:34 p.m. | OK | PyPy 3 | TESTS | 5 | 280 | 2048000 | ||
118447004 | mahitanaidu249 | B | June 4, 2021, 5:37 p.m. | OK | PyPy 3 | TESTS | 5 | 295 | 2048000 | ||
118448420 | kishank123 | B | June 4, 2021, 5:55 p.m. | OK | PyPy 3 | TESTS | 5 | 295 | 2150400 | ||
118451776 | SM16 | B | June 4, 2021, 6:44 p.m. | OK | PyPy 3 | TESTS | 5 | 296 | 1843200 | ||
118449983 | shubham_409 | B | June 4, 2021, 6:17 p.m. | OK | PyPy 3 | TESTS | 5 | 296 | 1843200 | ||
118440645 | Prajapat | B | June 4, 2021, 4:40 p.m. | OK | PyPy 3 | TESTS | 5 | 296 | 1843200 | ||
118440627 | wesee | B | June 4, 2021, 4:40 p.m. | OK | PyPy 3 | TESTS | 5 | 296 | 1945600 | ||
118444069 | eren1105 | B | June 4, 2021, 5:06 p.m. | OK | Python 3 | TESTS | 5 | 779 | 204800 | ||
118442179 | eugalt | B | June 4, 2021, 4:50 p.m. | OK | Python 3 | TESTS | 5 | 795 | 204800 | ||
118470120 | eugalt | B | June 5, 2021, 4:39 a.m. | OK | Python 3 | TESTS | 20 | 795 | 307200 | ||
118449926 | shubham_409 | B | June 4, 2021, 6:16 p.m. | OK | Python 3 | TESTS | 5 | 857 | 0 | ||
118449905 | shubham_409 | B | June 4, 2021, 6:16 p.m. | OK | Python 3 | TESTS | 5 | 857 | 0 | ||
118449447 | syntaxsugar | B | June 4, 2021, 6:09 p.m. | OK | Python 3 | TESTS | 5 | 873 | 0 | ||
118449393 | shubham_409 | B | June 4, 2021, 6:08 p.m. | OK | Python 3 | TESTS | 5 | 873 | 0 | ||
118449307 | syntaxsugar | B | June 4, 2021, 6:07 p.m. | OK | Python 3 | TESTS | 5 | 873 | 0 | ||
118440482 | eugalt | B | June 4, 2021, 4:39 p.m. | OK | Python 3 | TESTS | 5 | 873 | 0 | ||
118451139 | games.princeraj | B | June 4, 2021, 6:34 p.m. | OK | Python 3 | TESTS | 5 | 889 | 17715200 | ||
118441533 | f20180575 | B | June 4, 2021, 4:46 p.m. | OK | Python 3 + libs | TESTS | 5 | 748 | 0 | ||
118462644 | nikgaevoy | B | June 5, 2021, 1 a.m. | OK | Rust | TESTS | 20 | 218 | 102400 |
Back to search problems