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 |
|---|---|---|---|---|---|---|
| 850 | Codeforces Round 432 (Div. 1, based on IndiaHacks Final Round 2017) | FINISHED | False | 9000 | 271869923 | Sept. 4, 2017, 2:35 p.m. |
Solved |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
|---|---|---|---|---|---|---|
| ( 532 ) | E | Random Elections | PROGRAMMING | bitmasks brute force divide and conquer fft math | 2800 |
The presidential election is coming in Bearland next year! Everybody is so excited about this! So far, there are three candidates, Alice, Bob, and Charlie. There are n citizens in Bearland. The election result will determine the life of all citizens of Bearland for many years. Because of this great responsibility, each of n citizens will choose one of six orders of preference between Alice, Bob and Charlie uniformly at random, independently from other voters. The government of Bearland has devised a function to help determine the outcome of the election given the voters preferences. More specifically, the function is (takes n boolean numbers and returns a boolean number). The function also obeys the following property: f (1 - x 1 , 1 - x 2 , ..., 1 - x n ) = 1 - f ( x 1 , x 2 , ..., x n ) . Three rounds will be run between each pair of candidates: Alice and Bob, Bob and Charlie, Charlie and Alice. In each round, x i will be equal to 1 , if i -th citizen prefers the first candidate to second in this round, and 0 otherwise. After this, y = f ( x 1 , x 2 , ..., x n ) will be calculated. If y = 1 , the first candidate will be declared as winner in this round. If y = 0 , the second will be the winner, respectively. Define the probability that there is a candidate who won two rounds as p . p ·6 n is always an integer. Print the value of this integer modulo 10 9 + 7 = 1 000 000 007 . The first line contains one integer n ( 1 ≤ n ≤ 20 ). The next line contains a string of length 2 n of zeros and ones, representing function f . Let b k ( x ) the k -th bit in binary representation of x , i -th (0-based) digit of this string shows the return value of f ( b 1 ( i ), b 2 ( i ), ..., b n ( i )) . It is guaranteed that f (1 - x 1 , 1 - x 2 , ..., 1 - x n ) = 1 - f ( x 1 , x 2 , ..., x n ) for any values of x 1 , x 2 , ldots , x n . Output one integer — answer to the problem. In first sample, result is always fully determined by the first voter. In other words, f ( x 1 , |
| Codeforces Round #432 editorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 30121826 | MemS | E | Sept. 6, 2017, 3:19 a.m. | OK | GNU C++ | TESTS | 32 | 78 | 8396800 | 2800 | |
| 35823456 | TimeLimitExceed | E | March 2, 2018, 2:21 a.m. | OK | GNU C++ | TESTS | 32 | 108 | 10342400 | 2800 | |
| 30087694 | laofudasuan | E | Sept. 5, 2017, 1:20 a.m. | OK | GNU C++ | TESTS | 32 | 124 | 8396800 | 2800 | |
| 42260842 | Scut82 | E | Aug. 30, 2018, 3:04 a.m. | OK | GNU C++ | TESTS | 32 | 140 | 5222400 | 2800 | |
| 30492743 | black_horse2014 | E | Sept. 19, 2017, 9:40 a.m. | OK | GNU C++ | TESTS | 32 | 171 | 5222400 | 2800 | |
| 36866079 | vjudge2 | E | April 2, 2018, 1:11 a.m. | OK | GNU C++ | TESTS | 32 | 202 | 28774400 | 2800 | |
| 30062854 | shanquan2 | E | Sept. 4, 2017, 3:05 p.m. | OK | GNU C++ | TESTS | 32 | 249 | 10444800 | 2800 | |
| 32428071 | Scut82 | E | Nov. 18, 2017, 10:52 a.m. | OK | GNU C++ | TESTS | 32 | 265 | 5222400 | 2800 | |
| 30181781 | __stdcall | E | Sept. 7, 2017, 1 p.m. | OK | GNU C++ | TESTS | 32 | 295 | 16588800 | 2800 | |
| 36795135 | vjudge3 | E | April 1, 2018, 10:21 a.m. | OK | GNU C++ | TESTS | 32 | 296 | 29798400 | 2800 | |
| 30182680 | King_George | E | Sept. 7, 2017, 1:41 p.m. | OK | GNU C++11 | TESTS | 32 | 61 | 17715200 | 2800 | |
| 30089234 | rqgao2014 | E | Sept. 5, 2017, 3:12 a.m. | OK | GNU C++11 | TESTS | 32 | 62 | 13721600 | 2800 | |
| 40979981 | ReaLNero1 | E | July 30, 2018, 5:19 p.m. | OK | GNU C++11 | TESTS | 32 | 62 | 17715200 | 2800 | |
| 30182764 | King_George | E | Sept. 7, 2017, 1:45 p.m. | OK | GNU C++11 | TESTS | 32 | 62 | 17715200 | 2800 | |
| 30182487 | King_George | E | Sept. 7, 2017, 1:32 p.m. | OK | GNU C++11 | TESTS | 32 | 62 | 17715200 | 2800 | |
| 30182185 | King_George | E | Sept. 7, 2017, 1:17 p.m. | OK | GNU C++11 | TESTS | 32 | 62 | 17715200 | 2800 | |
| 30182147 | King_George | E | Sept. 7, 2017, 1:15 p.m. | OK | GNU C++11 | TESTS | 32 | 62 | 17715200 | 2800 | |
| 30182203 | King_George | E | Sept. 7, 2017, 1:18 p.m. | OK | GNU C++11 | TESTS | 32 | 77 | 17715200 | 2800 | |
| 30102444 | quailty | E | Sept. 5, 2017, 2:35 p.m. | OK | GNU C++11 | TESTS | 32 | 78 | 5222400 | 2800 | |
| 30179775 | PEDY4000 | E | Sept. 7, 2017, 11:39 a.m. | OK | GNU C++11 | TESTS | 32 | 78 | 8396800 | 2800 | |
| 31174075 | Kaban-5 | E | Oct. 9, 2017, 5:33 p.m. | OK | GNU C++14 | TESTS | 32 | 93 | 6860800 | 2800 | |
| 31174057 | Kaban-5 | E | Oct. 9, 2017, 5:32 p.m. | OK | GNU C++14 | TESTS | 32 | 93 | 6860800 | 2800 | |
| 30075459 | al13n | E | Sept. 4, 2017, 4:25 p.m. | OK | GNU C++14 | TESTS | 32 | 93 | 6860800 | 2800 | |
| 30197562 | irkstepanov | E | Sept. 8, 2017, 7:55 a.m. | OK | GNU C++14 | TESTS | 32 | 108 | 11059200 | 2800 | |
| 30083246 | LiChenKoh | E | Sept. 4, 2017, 7:37 p.m. | OK | GNU C++14 | TESTS | 32 | 109 | 9523200 | 2800 | |
| 33497228 | ztk | E | Dec. 22, 2017, 7:32 a.m. | OK | GNU C++14 | TESTS | 32 | 109 | 11366400 | 2800 | |
| 30078514 | Endagorion | E | Sept. 4, 2017, 4:50 p.m. | OK | GNU C++14 | TESTS | 32 | 109 | 12083200 | 2800 | |
| 34066570 | CQzhangyu | E | Jan. 10, 2018, 10:25 a.m. | OK | GNU C++14 | TESTS | 32 | 109 | 15564800 | 2800 | |
| 36149985 | Kaban-5 | E | March 10, 2018, 12:17 p.m. | OK | GNU C++14 | TESTS | 32 | 109 | 17100800 | 2800 | |
| 33662266 | otrecnoc | E | Dec. 27, 2017, 6:24 a.m. | OK | GNU C++14 | TESTS | 32 | 124 | 6144000 | 2800 | |
| 68460139 | icecuber | E | Jan. 9, 2020, 5:46 p.m. | OK | GNU C++17 | TESTS | 32 | 93 | 6860800 | 2800 | |
| 63284644 | isaf27 | E | Oct. 24, 2019, 9:53 a.m. | OK | GNU C++17 | TESTS | 32 | 93 | 15257600 | 2800 | |
| 64893192 | kefaa2 | E | Nov. 14, 2019, 3:30 p.m. | OK | GNU C++17 | TESTS | 32 | 124 | 8396800 | 2800 | |
| 68633353 | hjk1030 | E | Jan. 12, 2020, 4:28 a.m. | OK | GNU C++17 | TESTS | 32 | 202 | 13619200 | 2800 | |
| 55614509 | hjk1030 | E | June 16, 2019, 8:04 a.m. | OK | GNU C++17 | TESTS | 32 | 202 | 13619200 | 2800 | |
| 42249041 | Benq | E | Aug. 29, 2018, 5:12 p.m. | OK | GNU C++17 | TESTS | 32 | 202 | 48332800 | 2800 | |
| 47004329 | ShichengXiao | E | Dec. 14, 2018, 1:14 p.m. | OK | GNU C++17 | TESTS | 32 | 218 | 5222400 | 2800 | |
| 66872624 | justfocusplease | E | Dec. 14, 2019, 2:05 p.m. | OK | GNU C++17 | TESTS | 32 | 327 | 74035200 | 2800 | |
| 50293910 | Rzepa | E | Feb. 21, 2019, 7:07 p.m. | OK | GNU C++17 | TESTS | 32 | 342 | 20070400 | 2800 | |
| 58069698 | square1001 | E | July 31, 2019, 10:10 a.m. | OK | GNU C++17 | TESTS | 32 | 389 | 36249600 | 2800 | |
| 30199404 | mmaxio | E | Sept. 8, 2017, 9:55 a.m. | OK | Java 8 | TESTS | 32 | 530 | 13926400 | 2800 |
Back to search problems