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 |
| 643
|
VK Cup 2016 - Round 3 |
FINISHED |
False |
10800 |
313772123 |
May 7, 2016, 3:05 p.m. |
Problems
There are n bears in the inn and p places to sleep. Bears will party together for some number of nights (and days). Bears love drinking juice. They don't like wine but they can't distinguish it from juice by taste or smell. A bear doesn't sleep unless he drinks wine. A bear must go to sleep a few hours after drinking a wine. He will wake up many days after the party is over. Radewoosh is the owner of the inn. He wants to put some number of barrels in front of bears. One barrel will contain wine and all other ones will contain juice. Radewoosh will challenge bears to find a barrel with wine. Each night, the following happens in this exact order: Each bear must choose a (maybe empty) set of barrels. The same barrel may be chosen by many bears. Each bear drinks a glass from each barrel he chose. All bears who drink wine go to sleep (exactly those bears who chose a barrel with wine). They will wake up many days after the party is over. If there are not enough places to sleep then bears lose immediately. At the end, if it's sure where wine is and there is at least one awake bear then bears win (unless they have lost before because of the number of places to sleep). Radewoosh wants to allow bears to win. He considers q scenarios. In the i -th scenario the party will last for i nights. Then, let R i denote the maximum number of barrels for which bears surely win if they behave optimally. Let's define . Your task is to find , where denotes the exclusive or (also denoted as XOR). Note that the same barrel may be chosen by many bears and all of them will go to sleep at once. The only line of the input contains three integers n , p and q ( 1 ≤ n ≤ 10 9 , 1 ≤ p ≤ 130 , 1 ≤ q ≤ 2 000 000 ) — the number of bears, the number of places to sleep and the number of scenarios, respectively. Print one integer, equal to . In the first sample, there are 5 bears and only 1 place to sleep. We have R 1 = 6, R 2 = 11, R 3 = 16 so the answer is . Let's analyze the optimal strategy fo |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
|
17960910 |
themadprogramer |
F |
May 17, 2016, 6 a.m. |
OK |
GNU C++ |
TESTS |
33 |
265 |
2252800 |
|
2900 |
|
20027631 |
RNS_CUS |
F |
Aug. 21, 2016, 1:33 p.m. |
OK |
GNU C++ |
TESTS |
33 |
280 |
1843200 |
|
2900 |
|
17817130 |
Big_Bang_Theory |
F |
May 9, 2016, 8:34 a.m. |
OK |
GNU C++ |
TESTS |
33 |
280 |
2355200 |
|
2900 |
|
21238322 |
jiyutian |
F |
Oct. 6, 2016, 2:56 p.m. |
OK |
GNU C++ |
TESTS |
33 |
295 |
0 |
|
2900 |
|
20027654 |
RNS_CUS |
F |
Aug. 21, 2016, 1:34 p.m. |
OK |
GNU C++ |
TESTS |
33 |
295 |
2048000 |
|
2900 |
|
35887121 |
______M______ |
F |
March 3, 2018, 1:58 p.m. |
OK |
GNU C++ |
TESTS |
33 |
296 |
2048000 |
|
2900 |
|
18012728 |
DaibaNana |
F |
May 21, 2016, 3:15 a.m. |
OK |
GNU C++ |
TESTS |
33 |
312 |
2252800 |
|
2900 |
|
17839487 |
function348 |
F |
May 11, 2016, 6:23 a.m. |
OK |
GNU C++ |
TESTS |
33 |
343 |
2252800 |
|
2900 |
|
17876161 |
guille |
F |
May 12, 2016, 1:17 p.m. |
OK |
GNU C++ |
TESTS |
33 |
498 |
2560000 |
|
2900 |
|
23980529 |
ManiSadati |
F |
Jan. 20, 2017, 5:43 a.m. |
OK |
GNU C++ |
TESTS |
33 |
811 |
2150400 |
|
2900 |
|
25962009 |
mayakin |
F |
March 30, 2017, 7:05 p.m. |
OK |
GNU C++11 |
TESTS |
33 |
249 |
2252800 |
|
2900 |
|
40984842 |
ReaLNero1 |
F |
July 30, 2018, 7:36 p.m. |
OK |
GNU C++11 |
TESTS |
33 |
265 |
204800 |
|
2900 |
|
18535198 |
MohamedShawky |
F |
June 17, 2016, 3:43 a.m. |
OK |
GNU C++11 |
TESTS |
33 |
265 |
204800 |
|
2900 |
|
23980057 |
IMAN_GH |
F |
Jan. 20, 2017, 5:15 a.m. |
OK |
GNU C++11 |
TESTS |
33 |
265 |
2048000 |
|
2900 |
|
65708073 |
yasugongshang |
F |
Nov. 25, 2019, 1:19 p.m. |
OK |
GNU C++11 |
TESTS |
33 |
280 |
0 |
|
2900 |
|
65531582 |
142857 |
F |
Nov. 22, 2019, 12:39 p.m. |
OK |
GNU C++11 |
TESTS |
33 |
280 |
0 |
|
2900 |
|
64737296 |
Dilute |
F |
Nov. 12, 2019, 10:48 a.m. |
OK |
GNU C++11 |
TESTS |
33 |
280 |
0 |
|
2900 |
|
63922576 |
yhx-12243 |
F |
Oct. 31, 2019, 12:09 p.m. |
OK |
GNU C++11 |
TESTS |
33 |
280 |
0 |
|
2900 |
|
57881650 |
lopare |
F |
July 28, 2019, 8:04 a.m. |
OK |
GNU C++11 |
TESTS |
33 |
280 |
0 |
|
2900 |
|
57815744 |
py_ultron |
F |
July 26, 2019, 7:35 p.m. |
OK |
GNU C++11 |
TESTS |
33 |
280 |
0 |
|
2900 |
|
65702636 |
jiangly |
F |
Nov. 25, 2019, 11:23 a.m. |
OK |
GNU C++14 |
TESTS |
33 |
280 |
0 |
|
2900 |
|
32344556 |
NiroBC |
F |
Nov. 16, 2017, 2:12 a.m. |
OK |
GNU C++14 |
TESTS |
33 |
280 |
0 |
|
2900 |
|
68060597 |
251 |
F |
Jan. 2, 2020, 3:28 a.m. |
OK |
GNU C++14 |
TESTS |
33 |
280 |
102400 |
|
2900 |
|
68464702 |
ragen |
F |
Jan. 9, 2020, 7:40 p.m. |
OK |
GNU C++14 |
TESTS |
33 |
296 |
204800 |
|
2900 |
|
23409246 |
Ali.Pi |
F |
Dec. 29, 2016, 8:54 p.m. |
OK |
GNU C++14 |
TESTS |
33 |
311 |
2048000 |
|
2900 |
|
39063824 |
Mahdi_Jfri |
F |
June 9, 2018, 8:19 a.m. |
OK |
GNU C++14 |
TESTS |
33 |
312 |
204800 |
|
2900 |
|
39063663 |
Mahdi_Jfri |
F |
June 9, 2018, 8:11 a.m. |
OK |
GNU C++14 |
TESTS |
33 |
312 |
204800 |
|
2900 |
|
41115309 |
vjudge2 |
F |
Aug. 2, 2018, 8:43 a.m. |
OK |
GNU C++14 |
TESTS |
33 |
312 |
512000 |
|
2900 |
|
66376505 |
137_345_2814 |
F |
Dec. 6, 2019, 3:08 a.m. |
OK |
GNU C++14 |
TESTS |
33 |
343 |
22732800 |
|
2900 |
|
27723422 |
AmberFrame |
F |
June 11, 2017, 3:36 p.m. |
OK |
GNU C++14 |
TESTS |
33 |
639 |
24064000 |
|
2900 |
|
66560413 |
Martin53 |
F |
Dec. 9, 2019, 6:38 p.m. |
OK |
GNU C++17 |
TESTS |
33 |
280 |
0 |
|
2900 |
|
68445437 |
hjk1030 |
F |
Jan. 9, 2020, 12:31 p.m. |
OK |
GNU C++17 |
TESTS |
33 |
296 |
102400 |
|
2900 |
|
45148452 |
AliHeidary1381 |
F |
Oct. 31, 2018, 6:14 p.m. |
OK |
GNU C++17 |
TESTS |
33 |
296 |
307200 |
|
2900 |
|
44924890 |
am.azadi |
F |
Oct. 26, 2018, 7:36 p.m. |
OK |
GNU C++17 |
TESTS |
33 |
311 |
307200 |
|
2900 |
|
45148387 |
AliHeidary1381 |
F |
Oct. 31, 2018, 6:12 p.m. |
OK |
GNU C++17 |
TESTS |
33 |
312 |
307200 |
|
2900 |
|
44614235 |
SamMHD |
F |
Oct. 20, 2018, 10:43 p.m. |
OK |
GNU C++17 |
TESTS |
33 |
608 |
16793600 |
|
2900 |
|
44613988 |
SamMHD |
F |
Oct. 20, 2018, 10:26 p.m. |
OK |
GNU C++17 |
TESTS |
33 |
639 |
16793600 |
|
2900 |
|
68015673 |
AM. |
F |
Dec. 31, 2019, 6:19 p.m. |
OK |
GNU C++17 |
TESTS |
33 |
764 |
0 |
|
2900 |
|
54228305 |
Kianaz.A |
F |
May 16, 2019, 7:33 a.m. |
OK |
GNU C++17 |
TESTS |
33 |
857 |
204800 |
|
2900 |
|
54228477 |
mjn.bn |
F |
May 16, 2019, 7:38 a.m. |
OK |
GNU C++17 |
TESTS |
33 |
1013 |
0 |
|
2900 |
|
43817278 |
tri |
F |
Oct. 5, 2018, 6:14 a.m. |
OK |
Java 8 |
TESTS |
33 |
1762 |
0 |
|
2900 |
|
18952307 |
Los_Angelos_Laycurse |
F |
July 7, 2016, 1:24 p.m. |
OK |
MS C++ |
TESTS |
33 |
888 |
204800 |
|
2900 |
remove filters
Back to search problems