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"Ivan plays some computer game. There are n quests in the game. Each quest can be upgraded once, this increases the reward for its completion. Each quest has 3 parameters a_{i} , b_{i} , p_{i} : reward for completing quest before upgrade, reward for completing quest after upgrade ( a_{i} < b_{i} ) and probability of successful completing the quest. Each second Ivan can try to complete one quest and he will succeed with probability p_{i} . In case of success Ivan will get the reward and opportunity to upgrade any one quest (not necessary the one he just completed). In case of failure he gets nothing. Quests do not vanish after completing. Ivan has t seconds. He wants to maximize expected value of his total gain after t seconds. Help him to calculate this value. First line contains 2 integers n ( 1 <= n <= 10^{5} ) and t ( 1 <= t <= 10^{10} ) -- number of quests and total time. Following n lines contain description of quests. Each description is 3 numbers a_{i} b_{i} p_{i} ( 1 <= a_{i} < b_{i} <= 10^{8} , 0 < p_{i} < 1 ) -- reward for completing quest before upgrade, reward for completing quest after upgrade and probability of successful completing of quest. a_{i} and b_{i} are integers. All probabilities are given with at most 9 decimal places. Print the expected value. Your answer will be accepted if absolute or relative error does not exceed 10^{-6} . Formally, let your answer be a , and the jury's answer be b . Your answer is considered correct if frac{|a-b|}{max xe2 x81 xa1(b, , , 1)} <= 10^{-6} . "... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
59895977 |
hankeke |
D |
Sept. 2, 2019, 12:07 p.m. |
OK |
GNU C++11 |
TESTS |
110 |
93 |
3584000 |
|
2800 |
45378917 |
luogu_bot4 |
D |
Nov. 6, 2018, 1:43 p.m. |
OK |
GNU C++11 |
TESTS |
110 |
108 |
3276800 |
|
2800 |
48657267 |
ReaLNero1 |
D |
Jan. 21, 2019, 3:38 a.m. |
OK |
GNU C++11 |
TESTS |
110 |
109 |
3174400 |
|
2800 |
48325524 |
Tommyr7 |
D |
Jan. 13, 2019, 11:38 a.m. |
OK |
GNU C++11 |
TESTS |
110 |
109 |
3174400 |
|
2800 |
44813541 |
skywalkert |
D |
Oct. 24, 2018, 8:22 p.m. |
OK |
GNU C++11 |
TESTS |
110 |
124 |
3584000 |
|
2800 |
44830142 |
caoyue |
D |
Oct. 25, 2018, 8:04 a.m. |
OK |
GNU C++11 |
TESTS |
110 |
124 |
7987200 |
|
2800 |
45093714 |
Feeey |
D |
Oct. 30, 2018, 10:53 a.m. |
OK |
GNU C++11 |
TESTS |
110 |
171 |
3276800 |
|
2800 |
64667123 |
_DYT |
D |
Nov. 11, 2019, 3:20 a.m. |
OK |
GNU C++11 |
TESTS |
110 |
171 |
5222400 |
|
2800 |
52521562 |
mzhmxzh |
D |
April 9, 2019, 9:01 a.m. |
OK |
GNU C++11 |
TESTS |
110 |
186 |
3379200 |
|
2800 |
52521449 |
mzhmxzh |
D |
April 9, 2019, 8:57 a.m. |
OK |
GNU C++11 |
TESTS |
110 |
187 |
3481600 |
|
2800 |
45227524 |
consecutivelimit |
D |
Nov. 3, 2018, 4:45 a.m. |
OK |
GNU C++14 |
TESTS |
110 |
171 |
1638400 |
|
2800 |
45378789 |
Enzyme125 |
D |
Nov. 6, 2018, 1:40 p.m. |
OK |
GNU C++14 |
TESTS |
110 |
171 |
3174400 |
|
2800 |
53109756 |
yhx-12243 |
D |
April 22, 2019, 12:40 a.m. |
OK |
GNU C++14 |
TESTS |
110 |
171 |
4812800 |
|
2800 |
44811277 |
aid |
D |
Oct. 24, 2018, 6:34 p.m. |
OK |
GNU C++14 |
TESTS |
105 |
171 |
6758400 |
|
2800 |
59923028 |
Scut82 |
D |
Sept. 3, 2019, 1:16 a.m. |
OK |
GNU C++14 |
TESTS |
110 |
187 |
22425600 |
|
2800 |
44953131 |
jtnydv25 |
D |
Oct. 27, 2018, 1:03 p.m. |
OK |
GNU C++14 |
TESTS |
110 |
202 |
4403200 |
|
2800 |
45121584 |
YaKon4ick |
D |
Oct. 31, 2018, 5:04 a.m. |
OK |
GNU C++14 |
TESTS |
110 |
218 |
5427200 |
|
2800 |
44953041 |
jtnydv25 |
D |
Oct. 27, 2018, 1:01 p.m. |
OK |
GNU C++14 |
TESTS |
110 |
218 |
7270400 |
|
2800 |
45055008 |
Drin_E |
D |
Oct. 29, 2018, 12:21 p.m. |
OK |
GNU C++14 |
TESTS |
110 |
233 |
3174400 |
|
2800 |
53098242 |
bestFy |
D |
April 21, 2019, 2:48 p.m. |
OK |
GNU C++14 |
TESTS |
110 |
233 |
3276800 |
|
2800 |
45778537 |
m1sch3f |
D |
Nov. 15, 2018, 6:41 p.m. |
OK |
GNU C++17 |
TESTS |
110 |
171 |
14233600 |
|
2800 |
44810645 |
LHiC |
D |
Oct. 24, 2018, 6:32 p.m. |
OK |
GNU C++17 |
TESTS |
105 |
202 |
11980800 |
|
2800 |
44842534 |
Benq |
D |
Oct. 25, 2018, 1:17 p.m. |
OK |
GNU C++17 |
TESTS |
110 |
327 |
14131200 |
|
2800 |
69469503 |
hjk1030 |
D |
Jan. 24, 2020, 2:03 p.m. |
OK |
GNU C++17 |
TESTS |
110 |
421 |
7270400 |
|
2800 |
59968450 |
Xellos |
D |
Sept. 3, 2019, 10:24 p.m. |
OK |
GNU C++17 |
TESTS |
110 |
468 |
1740800 |
|
2800 |
68051942 |
kefaa2 |
D |
Jan. 1, 2020, 7:21 p.m. |
OK |
GNU C++17 |
TESTS |
110 |
577 |
6246400 |
|
2800 |
44821766 |
tEMMIE.w. |
D |
Oct. 25, 2018, 3 a.m. |
OK |
GNU C++17 |
TESTS |
110 |
889 |
5017600 |
|
2800 |
44821760 |
peehs_moorhsum |
D |
Oct. 25, 2018, 3 a.m. |
OK |
GNU C++17 |
TESTS |
110 |
889 |
5017600 |
|
2800 |
56463780 |
xht37 |
D |
July 3, 2019, 7:59 a.m. |
OK |
GNU C++17 |
TESTS |
110 |
951 |
6860800 |
|
2800 |
44889530 |
mango_lassi |
D |
Oct. 26, 2018, 2:05 a.m. |
OK |
GNU C++17 |
TESTS |
110 |
967 |
8601600 |
|
2800 |
68456901 |
dalt |
D |
Jan. 9, 2020, 4:35 p.m. |
OK |
Java 8 |
TESTS |
110 |
702 |
46387200 |
|
2800 |
68411262 |
Harpae |
D |
Jan. 8, 2020, 5:05 p.m. |
OK |
Java 8 |
TESTS |
110 |
2807 |
4096000 |
|
2800 |
68375334 |
Harpae |
D |
Jan. 7, 2020, 7:33 p.m. |
OK |
Java 8 |
TESTS |
110 |
2901 |
4096000 |
|
2800 |
68375302 |
Harpae |
D |
Jan. 7, 2020, 7:32 p.m. |
OK |
Java 8 |
TESTS |
110 |
2947 |
4096000 |
|
2800 |
68375182 |
Harpae |
D |
Jan. 7, 2020, 7:28 p.m. |
OK |
Java 8 |
TESTS |
110 |
2979 |
4096000 |
|
2800 |
68375102 |
Harpae |
D |
Jan. 7, 2020, 7:26 p.m. |
OK |
Java 8 |
TESTS |
110 |
2979 |
4096000 |
|
2800 |
68375021 |
Harpae |
D |
Jan. 7, 2020, 7:23 p.m. |
OK |
Java 8 |
TESTS |
110 |
2995 |
4096000 |
|
2800 |
remove filters
Back to search problems