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 |
---|---|---|---|---|---|---|
908 | Good Bye 2017 | FINISHED | False | 9000 | 217261199 | Dec. 29, 2017, 3:40 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 2392 ) | D | New Year and Arbitrary Arrangement | PROGRAMMING | dp math probabilities | 2200 |
B"You are given three integers k, pa and pb. You will construct a sequence with the following algorithm: Initially, start with the empty sequence. Each second, you do the following. With probability pa xe2 x80 x89/ xe2 x80 x89(pa xe2 x80 x89+ xe2 x80 x89pb), add 'a' to the end of the sequence. Otherwise (with probability pb xe2 x80 x89/ xe2 x80 x89(pa xe2 x80 x89+ xe2 x80 x89pb)), add 'b' to the end of the sequence. You stop once there are at least k subsequences that form 'ab'. Determine the expected number of times 'ab' is a subsequence in the resulting sequence. It can be shown that this can be represented by P xe2 x80 x89/ xe2 x80 x89Q, where P and Q are coprime integers, and . Print the value of . The first line will contain three integers integer k, xe2 x80 x89pa, xe2 x80 x89pb (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89k xe2 x80 x89 xe2 x89 xa4 xe2 x80 x891 xe2 x80 x89000, 1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89pa, xe2 x80 x89pb xe2 x80 x89 xe2 x89 xa4 xe2 x80 x891 xe2 x80 x89000 xe2 x80 x89000). Print a single integer, the answer to the problem. The first sample, we will keep appending to our sequence until we get the subsequence 'ab' at least once. For instance, we get the sequence 'ab' with probability 1/4, 'bbab' with probability 1/16, and 'aab' with probability 1/8. Note, it's impossible for us to end with a sequence like 'aabab', since we would have stopped our algorithm once we had the prefix 'aab'. The expected amount of times that 'ab' will occur across all valid sequences is 2. For the second sample, the answer is equal to . "... |
Good Bye 2017 Editorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
33777890 | yosupo | D | Dec. 29, 2017, 4:18 p.m. | OK | D | TESTS | 24 | 124 | 9011200 | 2200 | |
45412757 | luogu_bot5 | D | Nov. 7, 2018, 12:48 p.m. | OK | FPC | TESTS | 24 | 358 | 8192000 | 2200 | |
34629078 | TsReaper | D | Jan. 28, 2018, 9:31 a.m. | OK | GNU C | TESTS | 24 | 62 | 18124800 | 2200 | |
37144534 | Danieldh100 | D | April 10, 2018, 12:45 p.m. | OK | GNU C | TESTS | 24 | 62 | 19558400 | 2200 | |
33782272 | sgtlaugh | D | Dec. 29, 2017, 4:44 p.m. | OK | GNU C | TESTS | 24 | 140 | 10137600 | 2200 | |
33841910 | qianzhengjie | D | Jan. 1, 2018, 5:13 a.m. | OK | GNU C++ | TESTS | 24 | 15 | 5836800 | 2200 | |
34195977 | zhhx | D | Jan. 15, 2018, 12:07 p.m. | OK | GNU C++ | TESTS | 24 | 15 | 5939200 | 2200 | |
33912718 | ONION_CYC | D | Jan. 4, 2018, 11:20 p.m. | OK | GNU C++ | TESTS | 24 | 15 | 5939200 | 2200 | |
33842207 | qianzhengjie | D | Jan. 1, 2018, 6:02 a.m. | OK | GNU C++ | TESTS | 24 | 15 | 6041600 | 2200 | |
34694114 | luogu_bot2 | D | Jan. 30, 2018, 1:22 a.m. | OK | GNU C++ | TESTS | 24 | 15 | 6144000 | 2200 | |
34638068 | littlemiao | D | Jan. 28, 2018, 4:11 p.m. | OK | GNU C++ | TESTS | 24 | 15 | 6144000 | 2200 | |
33977489 | tangsan Hank2006 zhulingjun | D | Jan. 7, 2018, 6:43 a.m. | OK | GNU C++ | TESTS | 24 | 15 | 6144000 | 2200 | |
33790505 | ChunkitLau | D | Dec. 29, 2017, 6:01 p.m. | OK | GNU C++ | TESTS | 24 | 15 | 9932800 | 2200 | |
33898513 | vjudge3 | D | Jan. 4, 2018, 8:15 a.m. | OK | GNU C++ | TESTS | 24 | 15 | 10137600 | 2200 | |
35418034 | vjudge1 | D | Feb. 17, 2018, 1:46 p.m. | OK | GNU C++ | TESTS | 24 | 15 | 10240000 | 2200 | |
33856551 | magrady24 | D | Jan. 2, 2018, 1:25 a.m. | OK | GNU C++11 | TESTS | 24 | 15 | 5836800 | 2200 | |
33810221 | flower | D | Dec. 30, 2017, 1:31 p.m. | OK | GNU C++11 | TESTS | 24 | 15 | 5836800 | 2200 | |
35180736 | skl_win | D | Feb. 12, 2018, 2:26 p.m. | OK | GNU C++11 | TESTS | 24 | 15 | 5939200 | 2200 | |
33809834 | flower | D | Dec. 30, 2017, 1:12 p.m. | OK | GNU C++11 | TESTS | 24 | 15 | 6041600 | 2200 | |
33787187 | shdut | D | Dec. 29, 2017, 5:29 p.m. | OK | GNU C++11 | TESTS | 24 | 15 | 6041600 | 2200 | |
34881263 | wfj_2048 | D | Feb. 3, 2018, 3:32 a.m. | OK | GNU C++11 | TESTS | 24 | 15 | 6144000 | 2200 | |
34576888 | miaomiao_yali | D | Jan. 26, 2018, 1:30 p.m. | OK | GNU C++11 | TESTS | 24 | 15 | 6144000 | 2200 | |
34161386 | kelement | D | Jan. 13, 2018, 8:35 p.m. | OK | GNU C++11 | TESTS | 24 | 15 | 6144000 | 2200 | |
34073939 | narci6ix | D | Jan. 10, 2018, 5:05 p.m. | OK | GNU C++11 | TESTS | 24 | 15 | 6144000 | 2200 | |
34003884 | algzjh | D | Jan. 8, 2018, 12:57 p.m. | OK | GNU C++11 | TESTS | 24 | 15 | 6144000 | 2200 | |
34796020 | FDKevin | D | Feb. 1, 2018, 8:49 a.m. | OK | GNU C++14 | TESTS | 24 | 15 | 5836800 | 2200 | |
33800110 | ftiasch | D | Dec. 30, 2017, 3:54 a.m. | OK | GNU C++14 | TESTS | 24 | 15 | 5836800 | 2200 | |
34060338 | yanyikai | D | Jan. 10, 2018, 1:55 a.m. | OK | GNU C++14 | TESTS | 24 | 15 | 5939200 | 2200 | |
33960444 | Barceloner | D | Jan. 6, 2018, 10:04 a.m. | OK | GNU C++14 | TESTS | 24 | 15 | 5939200 | 2200 | |
33915450 | JiangYu | D | Jan. 5, 2018, 4:39 a.m. | OK | GNU C++14 | TESTS | 24 | 15 | 5939200 | 2200 | |
33872617 | carlosvfs | D | Jan. 2, 2018, 7:32 p.m. | OK | GNU C++14 | TESTS | 24 | 15 | 5939200 | 2200 | |
33827114 | shirryliu | D | Dec. 31, 2017, 7:59 a.m. | OK | GNU C++14 | TESTS | 24 | 15 | 5939200 | 2200 | |
33783904 | sdnr1 | D | Dec. 29, 2017, 4:57 p.m. | OK | GNU C++14 | TESTS | 24 | 15 | 5939200 | 2200 | |
33780893 | ania | D | Dec. 29, 2017, 4:34 p.m. | OK | GNU C++14 | TESTS | 24 | 15 | 5939200 | 2200 | |
33777773 | sigma425 | D | Dec. 29, 2017, 4:17 p.m. | OK | GNU C++14 | TESTS | 24 | 15 | 5939200 | 2200 | |
51819920 | pipipipipi43 | D | March 25, 2019, 11:30 a.m. | OK | GNU C++17 | TESTS | 24 | 30 | 3993600 | 2200 | |
65665244 | xz153531 | D | Nov. 24, 2019, 1:40 p.m. | OK | GNU C++17 | TESTS | 24 | 31 | 4096000 | 2200 | |
63517996 | HyscereXD | D | Oct. 27, 2019, 2:03 a.m. | OK | GNU C++17 | TESTS | 24 | 31 | 4096000 | 2200 | |
59684374 | Phortox | D | Aug. 29, 2019, 11:44 p.m. | OK | GNU C++17 | TESTS | 24 | 31 | 4096000 | 2200 | |
47708266 | mblazev | D | Dec. 29, 2018, 11:01 p.m. | OK | GNU C++17 | TESTS | 24 | 31 | 4096000 | 2200 | |
47184041 | ddpag | D | Dec. 18, 2018, 1:50 a.m. | OK | GNU C++17 | TESTS | 24 | 31 | 4300800 | 2200 | |
44952129 | wuyuyang200307 | D | Oct. 27, 2018, 12:36 p.m. | OK | GNU C++17 | TESTS | 24 | 31 | 4300800 | 2200 | |
39082871 | chenyeyuan | D | June 10, 2018, 4:16 a.m. | OK | GNU C++17 | TESTS | 24 | 31 | 4403200 | 2200 | |
61848489 | vjudge3 | D | Oct. 4, 2019, 12:01 p.m. | OK | GNU C++17 | TESTS | 24 | 31 | 8089600 | 2200 | |
40393456 | tyler | D | July 16, 2018, 2:59 a.m. | OK | GNU C++17 | TESTS | 24 | 31 | 8089600 | 2200 | |
33915859 | Kwords | D | Jan. 5, 2018, 5:24 a.m. | OK | GNU C++17 Diagnostics | TESTS | 24 | 888 | 104038400 | 2200 | |
34105250 | kingsnow | D | Jan. 12, 2018, 11:45 a.m. | OK | GNU C++17 Diagnostics | TESTS | 24 | 1092 | 121344000 | 2200 | |
33786787 | -skyline- | D | Dec. 29, 2017, 5:25 p.m. | OK | GNU C++17 Diagnostics | TESTS | 24 | 1262 | 140390400 | 2200 | |
33803500 | Rainte | D | Dec. 30, 2017, 7:37 a.m. | OK | GNU C++17 Diagnostics | TESTS | 24 | 1263 | 106086400 | 2200 | |
34237925 | nicon | D | Jan. 17, 2018, 1:45 a.m. | OK | Haskell | TESTS | 24 | 295 | 78643200 | 2200 | |
34237898 | nicon | D | Jan. 17, 2018, 1:40 a.m. | OK | Haskell | TESTS | 24 | 296 | 78643200 | 2200 | |
34237937 | nicon | D | Jan. 17, 2018, 1:46 a.m. | OK | Haskell | TESTS | 24 | 311 | 77516800 | 2200 | |
34238018 | nicon | D | Jan. 17, 2018, 1:57 a.m. | OK | Haskell | TESTS | 24 | 311 | 78643200 | 2200 | |
34237733 | nicon | D | Jan. 17, 2018, 1:20 a.m. | OK | Haskell | TESTS | 24 | 342 | 78643200 | 2200 | |
34238090 | nicon | D | Jan. 17, 2018, 2:05 a.m. | OK | Haskell | TESTS | 24 | 390 | 77516800 | 2200 | |
34234131 | nicon | D | Jan. 16, 2018, 10:10 p.m. | OK | Haskell | TESTS | 24 | 624 | 86016000 | 2200 | |
34234054 | nicon | D | Jan. 16, 2018, 10:05 p.m. | OK | Haskell | TESTS | 24 | 639 | 81715200 | 2200 | |
34231675 | nicon | D | Jan. 16, 2018, 8:04 p.m. | OK | Haskell | TESTS | 24 | 1777 | 114278400 | 2200 | |
33789562 | eatmore | D | Dec. 29, 2017, 5:53 p.m. | OK | Java 8 | TESTS | 24 | 139 | 20684800 | 2200 | |
37252832 | SrapZark | D | April 12, 2018, 2:10 p.m. | OK | Java 8 | TESTS | 24 | 140 | 20684800 | 2200 | |
37252777 | SrapZark | D | April 12, 2018, 2:08 p.m. | OK | Java 8 | TESTS | 24 | 140 | 20684800 | 2200 | |
34264704 | donli | D | Jan. 18, 2018, 2:30 a.m. | OK | Java 8 | TESTS | 24 | 140 | 20684800 | 2200 | |
33965769 | Asgar | D | Jan. 6, 2018, 3:45 p.m. | OK | Java 8 | TESTS | 24 | 140 | 20684800 | 2200 | |
33774899 | mmaxio | D | Dec. 29, 2017, 4:06 p.m. | OK | Java 8 | TESTS | 24 | 140 | 20684800 | 2200 | |
33772744 | Petr | D | Dec. 29, 2017, 3:58 p.m. | OK | Java 8 | TESTS | 24 | 140 | 20684800 | 2200 | |
34051474 | Sagar_Savaliya | D | Jan. 9, 2018, 2:46 p.m. | OK | Java 8 | TESTS | 24 | 140 | 27648000 | 2200 | |
33826154 | Juniorandrade | D | Dec. 31, 2017, 6:52 a.m. | OK | Java 8 | TESTS | 24 | 140 | 27648000 | 2200 | |
33826111 | Juniorandrade | D | Dec. 31, 2017, 6:48 a.m. | OK | Java 8 | TESTS | 24 | 140 | 27648000 | 2200 | |
33781241 | camypaper | D | Dec. 29, 2017, 4:37 p.m. | OK | MS C# | TESTS | 24 | 109 | 17408000 | 2200 | |
33916933 | katan | D | Jan. 5, 2018, 7:01 a.m. | OK | MS C++ | TESTS | 24 | 30 | 10240000 | 2200 | |
33797960 | Taube | D | Dec. 30, 2017, 12:43 a.m. | OK | MS C++ | TESTS | 24 | 31 | 151142400 | 2200 | |
33781354 | lucyanna2018 | D | Dec. 29, 2017, 4:37 p.m. | OK | MS C++ | TESTS | 24 | 46 | 6041600 | 2200 | |
43035175 | vjudge4 | D | Sept. 18, 2018, 1:20 p.m. | OK | MS C++ | TESTS | 24 | 46 | 8499200 | 2200 | |
49829275 | vjudge1 | D | Feb. 12, 2019, 1:11 p.m. | OK | MS C++ | TESTS | 24 | 62 | 4096000 | 2200 | |
33778887 | LoneFox | D | Dec. 29, 2017, 4:23 p.m. | OK | MS C++ | TESTS | 24 | 62 | 10137600 | 2200 | |
33789229 | waltz | D | Dec. 29, 2017, 5:50 p.m. | OK | MS C++ | TESTS | 24 | 77 | 6144000 | 2200 | |
33788244 | LLI_E_P_JI_O_K | D | Dec. 29, 2017, 5:40 p.m. | OK | MS C++ | TESTS | 24 | 218 | 18841600 | 2200 | |
49827676 | vjudge2 | D | Feb. 12, 2019, 12:28 p.m. | OK | MS C++ | TESTS | 24 | 467 | 8192000 | 2200 | |
49820373 | vjudge3 | D | Feb. 12, 2019, 8:31 a.m. | OK | MS C++ | TESTS | 24 | 468 | 4096000 | 2200 | |
33790242 | Darooha | D | Dec. 29, 2017, 5:59 p.m. | OK | Ocaml | TESTS | 24 | 467 | 24883200 | 2200 | |
60234828 | vjudge1 | D | Sept. 7, 2019, 5:54 p.m. | OK | PyPy 2 | TESTS | 24 | 202 | 7168000 | 2200 | |
33886339 | yugle7 | D | Jan. 3, 2018, 2:07 p.m. | OK | PyPy 3 | TESTS | 24 | 218 | 29696000 | 2200 | |
33789224 | pajenegod | D | Dec. 29, 2017, 5:49 p.m. | OK | PyPy 3 | TESTS | 24 | 1372 | 96358400 | 2200 | |
33826875 | soto_nlp | D | Dec. 31, 2017, 7:43 a.m. | OK | PyPy 3 | TESTS | 24 | 1387 | 96153600 | 2200 | |
33788691 | tjake | D | Dec. 29, 2017, 5:44 p.m. | OK | PyPy 3 | TESTS | 24 | 1481 | 102809600 | 2200 | |
33818273 | wangkan2001 | D | Dec. 30, 2017, 6:49 p.m. | OK | Python 2 | TESTS | 24 | 748 | 30412800 | 2200 | |
33877101 | noob__coder | D | Jan. 3, 2018, 4:59 a.m. | OK | Python 3 | TESTS | 24 | 1949 | 30310400 | 2200 | |
33877052 | noob__coder | D | Jan. 3, 2018, 4:56 a.m. | OK | Python 3 | TESTS | 24 | 1949 | 30310400 | 2200 | |
33850655 | sl0th | D | Jan. 1, 2018, 4:06 p.m. | OK | Rust | TESTS | 24 | 31 | 9523200 | 2200 |
Back to search problems