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"Hasan loves playing games and has recently discovered a game called TopScore. In this soccer-like game there are p players doing penalty shoot-outs. Winner is the one who scores the most. In case of ties, one of the top-scorers will be declared as the winner randomly with equal probability. They have just finished the game and now are waiting for the result. But there's a tiny problem! The judges have lost the paper of scores! Fortunately they have calculated sum of the scores before they get lost and also for some of the players they have remembered a lower bound on how much they scored. However, the information about the bounds is private, so Hasan only got to know his bound. According to the available data, he knows that his score is at least r and sum of the scores is s . Thus the final state of the game can be represented in form of sequence of p integers a_1, a_2, ... , a_p ( 0 <= a_i ) -- player's scores. Hasan is player number 1 , so a_1 ge r . Also a_1 + a_2 + ... + a_p = s . Two states are considered different if there exists some position i such that the value of a_i differs in these states. Once again, Hasan doesn't know the exact scores (he doesn't know his exact score as well). So he considers each of the final states to be equally probable to achieve. Help Hasan find the probability of him winning. It can be shown that it is in the form of frac{P}{Q} where P and Q are non-negative integers and Q ne 0 , P <= Q . Report the value of P cdot Q^{-1} pmod {998244353} . The only line contains three integers p , s and r ( 1 <= p <= 100 , 0 <= r <= s <= 5000 ) -- the number of players, the sum of scores of all players and Hasan's score, respectively. Print a single integer -- the probability of Hasan winning. It can be shown that it is in the form of frac{P}{Q} where P and Q are non-negative inte"... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
48473180 |
rainboy |
E |
Jan. 16, 2019, 11:17 p.m. |
OK |
GNU C11 |
TESTS |
23 |
436 |
6144000 |
|
2600 |
49688338 |
nealchen |
E |
Feb. 10, 2019, 9:28 a.m. |
OK |
GNU C++11 |
TESTS |
23 |
31 |
0 |
|
2600 |
47874957 |
chrt |
E |
Jan. 3, 2019, 2:51 p.m. |
OK |
GNU C++11 |
TESTS |
23 |
31 |
0 |
|
2600 |
63385302 |
_twilight |
E |
Oct. 25, 2019, 1:36 p.m. |
OK |
GNU C++11 |
TESTS |
23 |
31 |
102400 |
|
2600 |
57867518 |
lopare |
E |
July 27, 2019, 10:19 p.m. |
OK |
GNU C++11 |
TESTS |
23 |
31 |
102400 |
|
2600 |
57734361 |
py_ultron |
E |
July 25, 2019, 9:30 a.m. |
OK |
GNU C++11 |
TESTS |
23 |
31 |
102400 |
|
2600 |
54173218 |
Gaozijian |
E |
May 15, 2019, 12:31 p.m. |
OK |
GNU C++11 |
TESTS |
23 |
31 |
102400 |
|
2600 |
52565638 |
LZY_lzy |
E |
April 10, 2019, 12:18 p.m. |
OK |
GNU C++11 |
TESTS |
23 |
31 |
102400 |
|
2600 |
48477393 |
luogu_bot3 |
E |
Jan. 17, 2019, 3:49 a.m. |
OK |
GNU C++11 |
TESTS |
23 |
31 |
102400 |
|
2600 |
47964668 |
_23333 |
E |
Jan. 5, 2019, 11:29 a.m. |
OK |
GNU C++11 |
TESTS |
23 |
31 |
102400 |
|
2600 |
63707576 |
Blood_Wu_Ren |
E |
Oct. 29, 2019, 8:55 a.m. |
OK |
GNU C++11 |
TESTS |
23 |
31 |
102400 |
|
2600 |
47720931 |
Tosic |
E |
Dec. 30, 2018, 11:12 a.m. |
OK |
GNU C++14 |
TESTS |
23 |
30 |
102400 |
|
2600 |
47709436 |
tmwilliamlin168 |
E |
Dec. 30, 2018, 1:11 a.m. |
OK |
GNU C++14 |
TESTS |
23 |
30 |
102400 |
|
2600 |
48011805 |
TonySnark |
E |
Jan. 5, 2019, 7:37 p.m. |
OK |
GNU C++14 |
TESTS |
23 |
30 |
102400 |
|
2600 |
47707319 |
ExperienceD |
E |
Dec. 29, 2018, 9:45 p.m. |
OK |
GNU C++14 |
TESTS |
23 |
30 |
2355200 |
|
2600 |
47648933 |
Shayan |
E |
Dec. 28, 2018, 4:06 p.m. |
OK |
GNU C++14 |
TESTS |
23 |
30 |
5017600 |
|
2600 |
48972068 |
zhou888 |
E |
Jan. 26, 2019, 8:35 a.m. |
OK |
GNU C++14 |
TESTS |
23 |
31 |
0 |
|
2600 |
48070636 |
krijgertje |
E |
Jan. 7, 2019, 10:20 p.m. |
OK |
GNU C++14 |
TESTS |
23 |
31 |
102400 |
|
2600 |
47709455 |
tmwilliamlin168 |
E |
Dec. 30, 2018, 1:13 a.m. |
OK |
GNU C++14 |
TESTS |
23 |
31 |
102400 |
|
2600 |
63102490 |
sorry_to_tourist |
E |
Oct. 22, 2019, 1:58 a.m. |
OK |
GNU C++14 |
TESTS |
23 |
31 |
204800 |
|
2600 |
47718270 |
ytriayggg |
E |
Dec. 30, 2018, 9:26 a.m. |
OK |
GNU C++14 |
TESTS |
23 |
31 |
409600 |
|
2600 |
67571268 |
AliShahali1382 |
E |
Dec. 24, 2019, 10:06 p.m. |
OK |
GNU C++17 |
TESTS |
23 |
30 |
102400 |
|
2600 |
47675099 |
georgerapeanu |
E |
Dec. 29, 2018, 8:38 a.m. |
OK |
GNU C++17 |
TESTS |
23 |
30 |
2150400 |
|
2600 |
48654408 |
ReaLNero1 |
E |
Jan. 21, 2019, 1:32 a.m. |
OK |
GNU C++17 |
TESTS |
23 |
30 |
2150400 |
|
2600 |
47856444 |
mostafa.essam |
E |
Jan. 2, 2019, 10:59 p.m. |
OK |
GNU C++17 |
TESTS |
23 |
31 |
102400 |
|
2600 |
48187782 |
awmir._.mi |
E |
Jan. 10, 2019, 4:06 p.m. |
OK |
GNU C++17 |
TESTS |
23 |
31 |
102400 |
|
2600 |
62606046 |
hjk1030 |
E |
Oct. 15, 2019, 7:47 a.m. |
OK |
GNU C++17 |
TESTS |
23 |
31 |
819200 |
|
2600 |
47847718 |
ac517 |
E |
Jan. 2, 2019, 3:43 p.m. |
OK |
GNU C++17 |
TESTS |
23 |
31 |
4300800 |
|
2600 |
56638999 |
saketh |
E |
July 6, 2019, 10:46 p.m. |
OK |
GNU C++17 |
TESTS |
23 |
46 |
102400 |
|
2600 |
68830557 |
Ari |
E |
Jan. 14, 2020, 9:52 p.m. |
OK |
GNU C++17 |
TESTS |
23 |
46 |
102400 |
|
2600 |
60055308 |
Rose_max |
E |
Sept. 5, 2019, 3:41 a.m. |
OK |
GNU C++17 |
TESTS |
23 |
46 |
102400 |
|
2600 |
47655644 |
AkshajK |
E |
Dec. 28, 2018, 4:45 p.m. |
OK |
Java 8 |
TESTS |
23 |
109 |
0 |
|
2600 |
66810938 |
dalt |
E |
Dec. 14, 2019, 2:22 a.m. |
OK |
Java 8 |
TESTS |
23 |
171 |
19148800 |
|
2600 |
47795016 |
7dan |
E |
Dec. 31, 2018, 4:12 p.m. |
OK |
Java 8 |
TESTS |
23 |
186 |
0 |
|
2600 |
47676709 |
dusty.and.rusty |
E |
Dec. 29, 2018, 9:34 a.m. |
OK |
Java 8 |
TESTS |
23 |
202 |
0 |
|
2600 |
47655797 |
uwi |
E |
Dec. 28, 2018, 4:47 p.m. |
OK |
Java 8 |
TESTS |
23 |
202 |
0 |
|
2600 |
49492974 |
xodiac |
E |
Feb. 5, 2019, 11:09 a.m. |
OK |
Java 8 |
TESTS |
23 |
374 |
258662400 |
|
2600 |
47725480 |
mbrc |
E |
Dec. 30, 2018, 2 p.m. |
OK |
Java 8 |
TESTS |
23 |
638 |
258764800 |
|
2600 |
48473181 |
Dukkha |
E |
Jan. 16, 2019, 11:17 p.m. |
OK |
Java 8 |
TESTS |
23 |
794 |
0 |
|
2600 |
47725405 |
mbrc |
E |
Dec. 30, 2018, 1:58 p.m. |
OK |
Java 8 |
TESTS |
23 |
1076 |
258764800 |
|
2600 |
47718776 |
BaZ_ |
E |
Dec. 30, 2018, 9:44 a.m. |
OK |
Java 8 |
TESTS |
23 |
1933 |
0 |
|
2600 |
66600470 |
vjudge1 |
E |
Dec. 10, 2019, 4:19 p.m. |
OK |
MS C++ |
TESTS |
23 |
93 |
104550400 |
|
2600 |
47666863 |
cuom1999 |
E |
Dec. 29, 2018, 1:37 a.m. |
OK |
PyPy 3 |
TESTS |
23 |
499 |
120524800 |
|
2600 |
61554251 |
Umi |
E |
Sept. 30, 2019, 1:31 p.m. |
OK |
PyPy 3 |
TESTS |
23 |
530 |
10035200 |
|
2600 |
68576420 |
sansen |
E |
Jan. 11, 2020, 10:08 a.m. |
OK |
Rust |
TESTS |
23 |
46 |
0 |
|
2600 |
remove filters
Back to search problems