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.
Problems
B"Kuroni isn't good at economics. So he decided to found a new financial pyramid called Antihype. It has the following rules: n people have heard about Antihype recently, the i -th person's age is a_i . Some of them are friends, but friendship is a weird thing now: the i -th person is a friend of the j -th person if and only if a_i text{ AND } a_j = 0 , where text{AND} denotes the bitwise AND operation. Nobody among the n people is a member of Antihype at the moment. They want to cooperate to join and invite each other to Antihype in a way that maximizes their combined gainings. Could you help them? The first line contains a single integer n ( 1 <= n <= 2 cdot 10^5 ) -- the number of people. The second line contains n integers a_1, a_2, ... , a_n ( 0 <= a_i <= 2 cdot 10^5 ) -- the ages of the people. Output exactly one integer -- the maximum possible combined gainings of all n people. Only the first and second persons are friends. The second can join Antihype and invite the first one, getting 2 for it. "... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
72516377 |
AutumnKite |
G |
March 5, 2020, 1:51 p.m. |
OK |
GNU C++11 |
TESTS |
73 |
217 |
26726400 |
|
3300 |
72584986 |
Glu_TtoNy |
G |
March 6, 2020, 3:43 p.m. |
OK |
GNU C++11 |
TESTS |
73 |
311 |
28774400 |
|
3300 |
72584767 |
vjudge4 |
G |
March 6, 2020, 3:40 p.m. |
OK |
GNU C++11 |
TESTS |
73 |
312 |
28774400 |
|
3300 |
72584923 |
vjudge5 |
G |
March 6, 2020, 3:42 p.m. |
OK |
GNU C++11 |
TESTS |
73 |
342 |
28979200 |
|
3300 |
72548836 |
Deep_Kevin |
G |
March 6, 2020, 3:37 a.m. |
OK |
GNU C++11 |
TESTS |
73 |
499 |
23244800 |
|
3300 |
72397221 |
_twilight |
G |
March 4, 2020, 8:11 a.m. |
OK |
GNU C++11 |
TESTS |
73 |
514 |
7475200 |
|
3300 |
72511472 |
Rubbish12345 |
G |
March 5, 2020, 12:42 p.m. |
OK |
GNU C++11 |
TESTS |
73 |
561 |
90009600 |
|
3300 |
72396200 |
xtqqwq |
G |
March 4, 2020, 7:51 a.m. |
OK |
GNU C++11 |
TESTS |
73 |
577 |
7987200 |
|
3300 |
72584584 |
vjudge5 |
G |
March 6, 2020, 3:37 p.m. |
OK |
GNU C++11 |
TESTS |
73 |
592 |
28467200 |
|
3300 |
72417527 |
Isonan |
G |
March 4, 2020, 1:37 p.m. |
OK |
GNU C++11 |
TESTS |
73 |
607 |
13004800 |
|
3300 |
72582789 |
ILoveSetsuna |
G |
March 6, 2020, 3:07 p.m. |
OK |
GNU C++14 |
TESTS |
73 |
390 |
8396800 |
|
3300 |
72564870 |
mayaohua2003 |
G |
March 6, 2020, 10:07 a.m. |
OK |
GNU C++14 |
TESTS |
73 |
390 |
11264000 |
|
3300 |
72489630 |
ZZZZZZZZZZZZZZZZZZ |
G |
March 5, 2020, 6:10 a.m. |
OK |
GNU C++14 |
TESTS |
73 |
451 |
7372800 |
|
3300 |
72389596 |
JioFell |
G |
March 4, 2020, 5:41 a.m. |
OK |
GNU C++14 |
TESTS |
73 |
452 |
10547200 |
|
3300 |
72382473 |
Cyanic |
G |
March 4, 2020, 2:15 a.m. |
OK |
GNU C++14 |
TESTS |
73 |
468 |
8396800 |
|
3300 |
72387839 |
EntityIT |
G |
March 4, 2020, 4:54 a.m. |
OK |
GNU C++14 |
TESTS |
73 |
607 |
8192000 |
|
3300 |
72395044 |
Rubblsh12345 |
G |
March 4, 2020, 7:26 a.m. |
OK |
GNU C++14 |
TESTS |
73 |
748 |
8192000 |
|
3300 |
72397142 |
idxcalcal |
G |
March 4, 2020, 8:10 a.m. |
OK |
GNU C++14 |
TESTS |
73 |
1107 |
12288000 |
|
3300 |
72412479 |
clyring |
G |
March 4, 2020, 12:28 p.m. |
OK |
GNU C++14 |
TESTS |
73 |
1154 |
15564800 |
|
3300 |
72377944 |
Reyna |
G |
March 3, 2020, 11:11 p.m. |
OK |
GNU C++14 |
TESTS |
73 |
1294 |
15257600 |
|
3300 |
72371436 |
kefaa2 |
G |
March 3, 2020, 8:47 p.m. |
OK |
GNU C++17 |
TESTS |
73 |
405 |
10035200 |
|
3300 |
72366230 |
Akikaze |
G |
March 3, 2020, 7:11 p.m. |
OK |
GNU C++17 |
TESTS |
73 |
405 |
10035200 |
|
3300 |
72407891 |
Shayan.P |
G |
March 4, 2020, 11:13 a.m. |
OK |
GNU C++17 |
TESTS |
73 |
436 |
8396800 |
|
3300 |
72379886 |
AliShahali1382 |
G |
March 4, 2020, 12:43 a.m. |
OK |
GNU C++17 |
TESTS |
73 |
451 |
24268800 |
|
3300 |
72379776 |
AliShahali1382 |
G |
March 4, 2020, 12:39 a.m. |
OK |
GNU C++17 |
TESTS |
73 |
451 |
24268800 |
|
3300 |
72504804 |
Fulisike |
G |
March 5, 2020, 10:55 a.m. |
OK |
GNU C++17 |
TESTS |
73 |
468 |
7987200 |
|
3300 |
72468045 |
fusillade |
G |
March 4, 2020, 7:23 p.m. |
OK |
GNU C++17 |
TESTS |
73 |
468 |
11161600 |
|
3300 |
72602931 |
how_to_become_purple |
G |
March 6, 2020, 8:39 p.m. |
OK |
GNU C++17 |
TESTS |
73 |
514 |
6348800 |
|
3300 |
72435332 |
hjk1030 |
G |
March 4, 2020, 3:05 p.m. |
OK |
GNU C++17 |
TESTS |
73 |
545 |
10342400 |
|
3300 |
72363780 |
Benq |
G |
March 3, 2020, 6:39 p.m. |
OK |
GNU C++17 |
TESTS |
73 |
623 |
7680000 |
|
3300 |
72396298 |
cwise |
G |
March 4, 2020, 7:53 a.m. |
OK |
Java 8 |
TESTS |
73 |
1808 |
20172800 |
|
3300 |
72396375 |
cwise |
G |
March 4, 2020, 7:54 a.m. |
OK |
Java 8 |
TESTS |
73 |
2589 |
20275200 |
|
3300 |
remove filters
Back to search problems