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 |
---|---|---|---|---|---|---|
1299 | Codeforces Round 618 (Div. 1) | FINISHED | False | 7200 | 150566099 | Feb. 9, 2020, 2:05 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 12069 ) | A | Anu Has a Function | PROGRAMMING | brute force greedy math | 1500 |
B"Anu has created her own function f : f(x, y) = (x | y) - y where | denotes the bitwise OR operation. For example, f(11, 6) = (11|6) - 6 = 15 - 6 = 9 . It can be proved that for any nonnegative numbers x and y value of f(x, y) is also nonnegative. She would like to research more about this function and has created multiple problems for herself. But she isn't able to solve all of them and needs your help. Here is one of these problems. A value of an array [a_1, a_2, ... , a_n] is defined as f(f( ... f(f(a_1, a_2), a_3), ... a_{n-1}), a_n) (see notes). You are given an array with not necessarily distinct elements. How should you reorder its elements so that the value of the array is maximal possible? The first line contains a single integer n ( 1 <= n <= 10^5 ). The second line contains n integers a_1, a_2, ldots, a_n ( 0 <= a_i <= 10^9 ). Elements of the array are not guaranteed to be different. Output n integers, the reordering of the array with maximum value. If there are multiple answers, print any. In the first testcase, value of the array [11, 6, 4, 0] is f(f(f(11, 6), 4), 0) = f(f(9, 4), 0) = f(9, 0) = 9 . [11, 4, 0, 6] is also a valid answer. "... |
Codeforces Round #618 Editorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
70634936 | Gassa | A | Feb. 9, 2020, 2:15 p.m. | OK | D | TESTS | 39 | 93 | 4198400 | 1500 | |
70636800 | iica | A | Feb. 9, 2020, 2:18 p.m. | OK | D | TESTS | 39 | 109 | 22528000 | 1500 | |
70640484 | hos.lyric | A | Feb. 9, 2020, 2:23 p.m. | OK | D | TESTS | 39 | 124 | 11571200 | 1500 | |
70803182 | ruban | A | Feb. 11, 2020, 5:34 p.m. | OK | Delphi | TESTS | 39 | 93 | 80281600 | 1500 | |
70954888 | canhtoannct | A | Feb. 13, 2020, 12:31 p.m. | OK | FPC | TESTS | 39 | 358 | 1126400 | 1500 | |
70702118 | luogu_bot2 | A | Feb. 10, 2020, 3:19 a.m. | OK | GNU C++11 | TESTS | 39 | 46 | 409600 | 1500 | |
70631274 | LJC00118 | A | Feb. 9, 2020, 2:11 p.m. | OK | GNU C++11 | TESTS | 39 | 46 | 409600 | 1500 | |
70701387 | Sweetlemon | A | Feb. 10, 2020, 2:55 a.m. | OK | GNU C++11 | TESTS | 39 | 46 | 614400 | 1500 | |
70632509 | 11235813213455 | A | Feb. 9, 2020, 2:12 p.m. | OK | GNU C++11 | TESTS | 39 | 46 | 614400 | 1500 | |
70944753 | clfzs | A | Feb. 13, 2020, 9:26 a.m. | OK | GNU C++11 | TESTS | 39 | 46 | 819200 | 1500 | |
70704644 | lin_rany | A | Feb. 10, 2020, 4:38 a.m. | OK | GNU C++11 | TESTS | 39 | 46 | 819200 | 1500 | |
70727056 | luogu_bot1 | A | Feb. 10, 2020, 12:12 p.m. | OK | GNU C++11 | TESTS | 39 | 46 | 1024000 | 1500 | |
70642049 | shuashuawan | A | Feb. 9, 2020, 2:25 p.m. | OK | GNU C++11 | TESTS | 39 | 46 | 1228800 | 1500 | |
70631501 | stal_xy23z7b8 | A | Feb. 9, 2020, 2:11 p.m. | OK | GNU C++11 | TESTS | 39 | 46 | 1228800 | 1500 | |
70633315 | xay5421 | A | Feb. 9, 2020, 2:13 p.m. | OK | GNU C++11 | TESTS | 39 | 46 | 2457600 | 1500 | |
70769558 | BtnK_ij | A | Feb. 11, 2020, 6:28 a.m. | OK | GNU C++14 | TESTS | 39 | 62 | 409600 | 1500 | |
70732858 | ish591 | A | Feb. 10, 2020, 1:48 p.m. | OK | GNU C++14 | TESTS | 39 | 62 | 409600 | 1500 | |
70712536 | lamvh2812 | A | Feb. 10, 2020, 7:28 a.m. | OK | GNU C++14 | TESTS | 39 | 62 | 409600 | 1500 | |
70724208 | nikolapesic2802 | A | Feb. 10, 2020, 11:22 a.m. | OK | GNU C++14 | TESTS | 39 | 62 | 819200 | 1500 | |
70819507 | Malomalomalomalo | A | Feb. 12, 2020, 2:48 a.m. | OK | GNU C++14 | TESTS | 39 | 62 | 1228800 | 1500 | |
70747702 | riyazhusain812 | A | Feb. 10, 2020, 5:52 p.m. | OK | GNU C++14 | TESTS | 39 | 62 | 1228800 | 1500 | |
70745511 | sankalp_ | A | Feb. 10, 2020, 5:13 p.m. | OK | GNU C++14 | TESTS | 39 | 62 | 1228800 | 1500 | |
70697298 | BiIIy | A | Feb. 9, 2020, 11:59 p.m. | OK | GNU C++14 | TESTS | 39 | 62 | 1228800 | 1500 | |
70690700 | eeyore46656 | A | Feb. 9, 2020, 7:39 p.m. | OK | GNU C++14 | TESTS | 39 | 62 | 1228800 | 1500 | |
70689472 | koikotya | A | Feb. 9, 2020, 7:13 p.m. | OK | GNU C++14 | TESTS | 39 | 62 | 1228800 | 1500 | |
70631183 | JOHNKRAM | A | Feb. 9, 2020, 2:11 p.m. | OK | GNU C++17 | TESTS | 39 | 46 | 14131200 | 1500 | |
70692599 | LiChenKoh | A | Feb. 9, 2020, 8:27 p.m. | OK | GNU C++17 | TESTS | 39 | 61 | 1126400 | 1500 | |
70640734 | interestingLSY | A | Feb. 9, 2020, 2:23 p.m. | OK | GNU C++17 | TESTS | 39 | 61 | 1536000 | 1500 | |
70906158 | Ongore99 | A | Feb. 12, 2020, 5:11 p.m. | OK | GNU C++17 | TESTS | 39 | 62 | 409600 | 1500 | |
70783410 | 2018213496 | A | Feb. 11, 2020, 11:31 a.m. | OK | GNU C++17 | TESTS | 39 | 62 | 409600 | 1500 | |
70726708 | sushkov.pv | A | Feb. 10, 2020, 12:05 p.m. | OK | GNU C++17 | TESTS | 39 | 62 | 409600 | 1500 | |
70718337 | Denchik888 | A | Feb. 10, 2020, 9:18 a.m. | OK | GNU C++17 | TESTS | 39 | 62 | 409600 | 1500 | |
70630475 | yosupo | A | Feb. 9, 2020, 2:10 p.m. | OK | GNU C++17 | TESTS | 39 | 62 | 512000 | 1500 | |
70638278 | idxcalcal | A | Feb. 9, 2020, 2:20 p.m. | OK | GNU C++17 | TESTS | 39 | 62 | 716800 | 1500 | |
70716429 | waynetuinfor | A | Feb. 10, 2020, 8:41 a.m. | OK | GNU C++17 | TESTS | 39 | 62 | 819200 | 1500 | |
70776116 | badcw | A | Feb. 11, 2020, 8:57 a.m. | OK | Go | TESTS | 39 | 78 | 0 | 1500 | |
70954972 | badcw | A | Feb. 13, 2020, 12:33 p.m. | OK | Go | TESTS | 39 | 155 | 0 | 1500 | |
70630786 | ilyakor | A | Feb. 9, 2020, 2:10 p.m. | OK | Java 11 | TESTS | 39 | 218 | 0 | 1500 | |
70632074 | Lewin | A | Feb. 9, 2020, 2:12 p.m. | OK | Java 11 | TESTS | 39 | 233 | 0 | 1500 | |
70631728 | Suzukaze | A | Feb. 9, 2020, 2:11 p.m. | OK | Java 11 | TESTS | 39 | 265 | 0 | 1500 | |
70636160 | ZeyadKhattab | A | Feb. 9, 2020, 2:17 p.m. | OK | Java 11 | TESTS | 39 | 296 | 0 | 1500 | |
70635824 | mikit | A | Feb. 9, 2020, 2:16 p.m. | OK | Java 11 | TESTS | 39 | 296 | 18944000 | 1500 | |
71092896 | aaaaaaason | A | Feb. 15, 2020, 3:01 a.m. | OK | Java 11 | TESTS | 39 | 374 | 0 | 1500 | |
70699987 | sajith | A | Feb. 10, 2020, 2:04 a.m. | OK | Java 11 | TESTS | 39 | 545 | 12902400 | 1500 | |
70797816 | Hexomiter | A | Feb. 11, 2020, 4:02 p.m. | OK | Java 11 | TESTS | 39 | 717 | 0 | 1500 | |
70682562 | fetetriste | A | Feb. 9, 2020, 5:20 p.m. | OK | Java 8 | TESTS | 39 | 155 | 0 | 1500 | |
70636761 | cwise | A | Feb. 9, 2020, 2:17 p.m. | OK | Java 8 | TESTS | 39 | 155 | 20172800 | 1500 | |
70697192 | BiIIy | A | Feb. 9, 2020, 11:52 p.m. | OK | Java 8 | TESTS | 39 | 171 | 0 | 1500 | |
70647262 | barakraganosungam | A | Feb. 9, 2020, 2:35 p.m. | OK | Java 8 | TESTS | 39 | 171 | 0 | 1500 | |
70635462 | Xylenox | A | Feb. 9, 2020, 2:16 p.m. | OK | Java 8 | TESTS | 39 | 171 | 0 | 1500 | |
70633858 | Taran_1407 | A | Feb. 9, 2020, 2:14 p.m. | OK | Java 8 | TESTS | 39 | 171 | 0 | 1500 | |
70630480 | uwi | A | Feb. 9, 2020, 2:10 p.m. | OK | Java 8 | TESTS | 39 | 171 | 0 | 1500 | |
70639054 | Hemose | A | Feb. 9, 2020, 2:21 p.m. | OK | Java 8 | TESTS | 39 | 187 | 0 | 1500 | |
70636696 | SpargelTarzan | A | Feb. 9, 2020, 2:17 p.m. | OK | Java 8 | TESTS | 39 | 187 | 0 | 1500 | |
70633047 | about | A | Feb. 9, 2020, 2:13 p.m. | OK | Java 8 | TESTS | 39 | 187 | 0 | 1500 | |
70704404 | Spheniscine | A | Feb. 10, 2020, 4:30 a.m. | OK | Kotlin | TESTS | 39 | 202 | 3276800 | 1500 | |
70632315 | Tlatoani | A | Feb. 9, 2020, 2:12 p.m. | OK | Kotlin | TESTS | 39 | 265 | 819200 | 1500 | |
70650947 | riantkb | A | Feb. 9, 2020, 2:43 p.m. | OK | Mono C# | TESTS | 39 | 140 | 24268800 | 1500 | |
71090302 | ilia.brahinets | A | Feb. 15, 2020, 12:53 a.m. | OK | Mono C# | TESTS | 39 | 140 | 25600000 | 1500 | |
70634821 | keymoon | A | Feb. 9, 2020, 2:15 p.m. | OK | Mono C# | TESTS | 39 | 155 | 30105600 | 1500 | |
70656566 | lxhgww | A | Feb. 9, 2020, 2:56 p.m. | OK | MS C++ | TESTS | 39 | 78 | 409600 | 1500 | |
70635038 | math957963 | A | Feb. 9, 2020, 2:15 p.m. | OK | MS C++ | TESTS | 39 | 93 | 1638400 | 1500 | |
71049177 | vjudge2 | A | Feb. 14, 2020, 9:23 a.m. | OK | MS C++ | TESTS | 39 | 93 | 3993600 | 1500 | |
70713804 | vjudge5 | A | Feb. 10, 2020, 7:51 a.m. | OK | MS C++ | TESTS | 39 | 108 | 7987200 | 1500 | |
70642038 | tarattata1 | A | Feb. 9, 2020, 2:25 p.m. | OK | MS C++ | TESTS | 39 | 108 | 13209600 | 1500 | |
70632458 | pichulia | A | Feb. 9, 2020, 2:12 p.m. | OK | MS C++ 2017 | TESTS | 39 | 93 | 819200 | 1500 | |
70642214 | youx | A | Feb. 9, 2020, 2:26 p.m. | OK | MS C++ 2017 | TESTS | 39 | 109 | 11264000 | 1500 | |
70638951 | vpike | A | Feb. 9, 2020, 2:21 p.m. | OK | MS C++ 2017 | TESTS | 39 | 140 | 1228800 | 1500 | |
70730211 | Parsa84 | A | Feb. 10, 2020, 1:04 p.m. | OK | MS C++ 2017 | TESTS | 39 | 171 | 716800 | 1500 | |
70837880 | sladkayaKlubnichka | A | Feb. 12, 2020, 10:53 a.m. | OK | MS C++ 2017 | TESTS | 39 | 171 | 1228800 | 1500 | |
70822787 | hnust_yexueqi | A | Feb. 12, 2020, 4:54 a.m. | OK | MS C++ 2017 | TESTS | 39 | 171 | 1433600 | 1500 | |
70730002 | Parsa84 | A | Feb. 10, 2020, 1:01 p.m. | OK | MS C++ 2017 | TESTS | 39 | 186 | 716800 | 1500 | |
71009595 | AAKH76 | A | Feb. 13, 2020, 5:14 p.m. | OK | MS C++ 2017 | TESTS | 39 | 187 | 409600 | 1500 | |
70757979 | fedya_miron | A | Feb. 10, 2020, 10:26 p.m. | OK | MS C++ 2017 | TESTS | 39 | 187 | 1228800 | 1500 | |
70640433 | AlexanderL | A | Feb. 9, 2020, 2:23 p.m. | OK | MS C++ 2017 | TESTS | 39 | 202 | 409600 | 1500 | |
70630191 | pajenegod | A | Feb. 9, 2020, 2:09 p.m. | OK | PyPy 2 | TESTS | 39 | 202 | 13414400 | 1500 | |
70641729 | bcollet | A | Feb. 9, 2020, 2:25 p.m. | OK | PyPy 2 | TESTS | 39 | 811 | 16281600 | 1500 | |
70732161 | aberent | A | Feb. 10, 2020, 1:36 p.m. | OK | PyPy 3 | TESTS | 39 | 327 | 15872000 | 1500 | |
71042298 | gaidash | A | Feb. 14, 2020, 7:18 a.m. | OK | PyPy 3 | TESTS | 39 | 342 | 13721600 | 1500 | |
71042238 | gaidash | A | Feb. 14, 2020, 7:17 a.m. | OK | PyPy 3 | TESTS | 39 | 342 | 13721600 | 1500 | |
71040506 | gaidash | A | Feb. 14, 2020, 6:47 a.m. | OK | PyPy 3 | TESTS | 39 | 342 | 13721600 | 1500 | |
70642383 | cftt | A | Feb. 9, 2020, 2:26 p.m. | OK | PyPy 3 | TESTS | 39 | 358 | 14643200 | 1500 | |
70650416 | nagitaosu | A | Feb. 9, 2020, 2:42 p.m. | OK | PyPy 3 | TESTS | 39 | 374 | 11571200 | 1500 | |
70641796 | asvasil | A | Feb. 9, 2020, 2:25 p.m. | OK | PyPy 3 | TESTS | 39 | 374 | 13721600 | 1500 | |
70793164 | dnkywin | A | Feb. 11, 2020, 2:41 p.m. | OK | PyPy 3 | TESTS | 39 | 374 | 14131200 | 1500 | |
70639081 | titia | A | Feb. 9, 2020, 2:21 p.m. | OK | PyPy 3 | TESTS | 39 | 389 | 11366400 | 1500 | |
70701152 | Waiting | A | Feb. 10, 2020, 2:46 a.m. | OK | PyPy 3 | TESTS | 39 | 389 | 13926400 | 1500 | |
70634051 | nwi | A | Feb. 9, 2020, 2:14 p.m. | OK | Python 2 | TESTS | 39 | 280 | 12800000 | 1500 | |
70690424 | LintuStorm | A | Feb. 9, 2020, 7:33 p.m. | OK | Python 3 | TESTS | 39 | 280 | 13824000 | 1500 | |
70748375 | aakarsh | A | Feb. 10, 2020, 6:05 p.m. | OK | Python 3 | TESTS | 39 | 327 | 8908800 | 1500 | |
70682764 | vishweshshrimali5 | A | Feb. 9, 2020, 5:22 p.m. | OK | Python 3 | TESTS | 39 | 358 | 15462400 | 1500 | |
70804235 | eugalt | A | Feb. 11, 2020, 5:52 p.m. | OK | Python 3 | TESTS | 39 | 374 | 15872000 | 1500 | |
70944974 | harsh_thakur | A | Feb. 13, 2020, 9:29 a.m. | OK | Python 3 | TESTS | 39 | 436 | 9728000 | 1500 | |
70709402 | Comrade001 | A | Feb. 10, 2020, 6:25 a.m. | OK | Python 3 | TESTS | 39 | 545 | 8908800 | 1500 | |
70633820 | sansen | A | Feb. 9, 2020, 2:14 p.m. | OK | Rust | TESTS | 39 | 62 | 4505600 | 1500 |
Back to search problems