MemSQL Start[c]UP 2.0 - Round 1

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
452 MemSQL Start[c]UP 2.0 - Round 1 FINISHED False 9000 331649993 July 27, 2014, 5 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 1655 ) C Magic Trick PROGRAMMING combinatorics math probabilities 2100

B"Alex enjoys performing magic tricks. He has a trick that requires a deck of n cards. He has m identical decks of n different cards each, which have been mixed together. When Alex wishes to perform the trick, he grabs n cards at random and performs the trick with those. The resulting deck looks like a normal deck, but may have duplicates of some cards. The trick itself is performed as follows: first Alex allows you to choose a random card from the deck. You memorize the card and put it back in the deck. Then Alex shuffles the deck, and pulls out a card. If the card matches the one you memorized, the trick is successful. You don't think Alex is a very good magician, and that he just pulls a card randomly from the deck. Determine the probability of the trick being successful if this is the case. First line of the input consists of two integers n and m (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n, xe2 x80 x89m xe2 x80 x89 xe2 x89 xa4 xe2 x80 x891000), separated by space -- number of cards in each deck, and number of decks. On the only line of the output print one floating point number xe2 x80 x93 probability of Alex successfully performing the trick. Relative or absolute error of your answer should not be higher than 10 xe2 x80 x89- xe2 x80 x896. In the first sample, with probability Alex will perform the trick with two cards with the same value from two different decks. In this case the trick is guaranteed to succeed. With the remaining probability he took two different cards, and the probability of pulling off the trick is . The resulting probability is "...

Tutorials

MemSQL Start[c]UP 2.0 Round 1 and 2 Editorials

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
7263178 Gassa C July 27, 2014, 5:37 p.m. OK D TESTS 17 15 0 2100
12464784 jiangyx C Aug. 11, 2015, 10:11 a.m. OK FPC TESTS 17 15 0 2100
11681485 igdor99 C June 20, 2015, 12:05 p.m. OK FPC TESTS 17 15 0 2100
7299476 gyz_gyz C July 31, 2014, 12:23 p.m. OK FPC TESTS 17 15 0 2100
7276333 graceoflives C July 28, 2014, 9:42 a.m. OK FPC TESTS 17 15 0 2100
7273989 artem1416 C July 28, 2014, 4:32 a.m. OK FPC TESTS 17 15 0 2100
7271915 AllCatsAreBeautiful C July 27, 2014, 9:04 p.m. OK FPC TESTS 17 15 0 2100
7269356 Alex_2oo8 C July 27, 2014, 7:11 p.m. OK FPC TESTS 17 15 0 2100
7275885 MrJigan1488 C July 28, 2014, 8:49 a.m. OK FPC TESTS 17 30 14540800 2100
36073898 rainboy C March 8, 2018, 2:19 p.m. OK GNU C TESTS 17 15 1843200 2100
7269034 sgtlaugh C July 27, 2014, 7:04 p.m. OK GNU C TESTS 17 15 8192000 2100
7396321 clickme8 C Aug. 8, 2014, 7:29 p.m. OK GNU C TESTS 17 31 0 2100
7346084 CHVRCHES C Aug. 4, 2014, 3:11 p.m. OK GNU C TESTS 17 31 0 2100
40988189 ReaLNero1 C July 30, 2018, 9:48 p.m. OK GNU C++ TESTS 17 15 0 2100
31912851 EurusHolmes C Oct. 31, 2017, 7:16 a.m. OK GNU C++ TESTS 17 15 0 2100
20474787 abhi1agarwal C Sept. 9, 2016, 8:53 a.m. OK GNU C++ TESTS 17 15 0 2100
19326573 Espylacopa C July 22, 2016, 2:53 p.m. OK GNU C++ TESTS 17 15 0 2100
19197756 vjudge2 C July 18, 2016, 12:31 a.m. OK GNU C++ TESTS 17 15 0 2100
19163396 vjudge2 C July 16, 2016, 1:18 a.m. OK GNU C++ TESTS 17 15 0 2100
19148522 vjudge4 C July 15, 2016, 8:54 a.m. OK GNU C++ TESTS 17 15 0 2100
19146713 vjudge2 C July 15, 2016, 7:47 a.m. OK GNU C++ TESTS 17 15 0 2100
19144751 vjudge5 C July 15, 2016, 6:31 a.m. OK GNU C++ TESTS 17 15 0 2100
18973251 olee12 C July 8, 2016, 4:49 p.m. OK GNU C++ TESTS 17 15 0 2100
10122556 bartosz C March 2, 2015, 4:50 p.m. OK GNU C++0x TESTS 17 15 0 2100
9397982 determinism C Jan. 10, 2015, 2:38 p.m. OK GNU C++0x TESTS 17 15 0 2100
9085133 SherifWaly C Dec. 11, 2014, 7:32 p.m. OK GNU C++0x TESTS 17 15 0 2100
8181816 omochan C Oct. 12, 2014, 9:33 a.m. OK GNU C++0x TESTS 17 15 0 2100
8125516 nuip C Oct. 7, 2014, 4:14 a.m. OK GNU C++0x TESTS 17 15 0 2100
7902267 HappyPerson C Sept. 22, 2014, 3:34 a.m. OK GNU C++0x TESTS 17 15 0 2100
7495293 ershov.stanislav C Aug. 17, 2014, 7:12 p.m. OK GNU C++0x TESTS 17 15 0 2100
7477924 dasko1 C Aug. 16, 2014, 12:11 a.m. OK GNU C++0x TESTS 17 15 0 2100
7333876 hogloid C Aug. 3, 2014, 2:36 a.m. OK GNU C++0x TESTS 17 15 0 2100
7294147 asayko C July 30, 2014, 4:01 p.m. OK GNU C++0x TESTS 17 15 0 2100
64663511 v_3e8 C Nov. 10, 2019, 11:09 p.m. OK GNU C++11 TESTS 17 15 0 2100
57819186 py_ultron C July 26, 2019, 9:42 p.m. OK GNU C++11 TESTS 17 15 0 2100
40364263 tusikalanse C July 15, 2018, 4:22 a.m. OK GNU C++11 TESTS 17 15 0 2100
31948075 Georeth C Nov. 1, 2017, 11:40 a.m. OK GNU C++11 TESTS 17 15 0 2100
30380809 redocyz C Sept. 16, 2017, 10:11 a.m. OK GNU C++11 TESTS 17 15 0 2100
30338115 wineColoredDays C Sept. 14, 2017, 8:24 p.m. OK GNU C++11 TESTS 17 15 0 2100
23022384 aaijmrt C Dec. 16, 2016, 5:14 a.m. OK GNU C++11 TESTS 17 15 0 2100
22276409 MaGaroo C Nov. 16, 2016, 7:43 p.m. OK GNU C++11 TESTS 17 15 0 2100
18649012 I_Love_MohseN C June 22, 2016, 3:38 p.m. OK GNU C++11 TESTS 17 15 0 2100
16306980 zscoder C Feb. 24, 2016, 10:35 a.m. OK GNU C++11 TESTS 17 15 0 2100
68651567 FatalDestiny C Jan. 12, 2020, 10:55 a.m. OK GNU C++14 TESTS 17 15 0 2100
48041793 ghost_of_sparta1 C Jan. 6, 2019, 8:07 p.m. OK GNU C++14 TESTS 17 15 0 2100
45448762 s1ddharth3 C Nov. 8, 2018, 2:47 p.m. OK GNU C++14 TESTS 17 15 0 2100
40373215 vjudge1 C July 15, 2018, 9:20 a.m. OK GNU C++14 TESTS 17 15 0 2100
32498512 vjudge1 C Nov. 20, 2017, 12:06 p.m. OK GNU C++14 TESTS 17 15 0 2100
32308013 tanmay273 C Nov. 14, 2017, 9:51 a.m. OK GNU C++14 TESTS 17 15 0 2100
30805725 Milad C Sept. 28, 2017, 1:17 p.m. OK GNU C++14 TESTS 17 15 0 2100
30377181 SarvagyaAgarwal C Sept. 16, 2017, 6:13 a.m. OK GNU C++14 TESTS 17 15 0 2100
30371924 fofao_funk C Sept. 15, 2017, 8:29 p.m. OK GNU C++14 TESTS 17 15 0 2100
30366288 SureYeaah C Sept. 15, 2017, 3:20 p.m. OK GNU C++14 TESTS 17 15 0 2100
46126795 m1sch3f C Nov. 23, 2018, 7:44 p.m. OK GNU C++17 TESTS 17 15 0 2100
41543688 vjudge1 C Aug. 13, 2018, 2:27 a.m. OK GNU C++17 TESTS 17 15 0 2100
40373199 wzz-huchi C July 15, 2018, 9:19 a.m. OK GNU C++17 TESTS 17 15 0 2100
39274154 karasek C June 15, 2018, 7:43 p.m. OK GNU C++17 TESTS 17 15 0 2100
39274091 karasek C June 15, 2018, 7:37 p.m. OK GNU C++17 TESTS 17 15 0 2100
44741783 chuducanhchy C Oct. 23, 2018, 2:59 p.m. OK GNU C++17 TESTS 17 15 204800 2100
60298359 stArliGht C Sept. 9, 2019, 11:11 a.m. OK GNU C++17 TESTS 17 30 0 2100
56755029 ShevanovV C July 9, 2019, 1:31 p.m. OK GNU C++17 TESTS 17 30 0 2100
45457716 aviroop123 C Nov. 8, 2018, 8:38 p.m. OK GNU C++17 TESTS 17 30 0 2100
43919430 MahmoudHamdyY C Oct. 6, 2018, 9:26 p.m. OK GNU C++17 TESTS 17 30 0 2100
10516647 qqz003 C March 29, 2015, 2:15 p.m. OK Haskell TESTS 17 15 0 2100
7273809 delta_4d C July 28, 2014, 3:51 a.m. OK Haskell TESTS 17 15 0 2100
7287191 aznswimmerboi C July 29, 2014, 6:08 p.m. OK Java 6 TESTS 17 77 0 2100
7269549 xiaowuc1 C July 27, 2014, 7:15 p.m. OK Java 6 TESTS 17 77 0 2100
7262361 mkirsche C July 27, 2014, 5:30 p.m. OK Java 6 TESTS 17 77 0 2100
9357161 TranCongDuy C Jan. 4, 2015, 3:10 a.m. OK Java 6 TESTS 17 92 0 2100
7275178 leogzl C July 28, 2014, 7:35 a.m. OK Java 6 TESTS 17 93 0 2100
7263595 danbanica C July 27, 2014, 5:42 p.m. OK Java 6 TESTS 17 93 0 2100
7427301 mukeshmit C Aug. 11, 2014, 1 p.m. OK Java 6 TESTS 17 109 0 2100
7427260 mukeshmit C Aug. 11, 2014, 12:54 p.m. OK Java 6 TESTS 17 109 0 2100
7268813 tsotne C July 27, 2014, 7 p.m. OK Java 6 TESTS 17 187 0 2100
9421823 alibaba C Jan. 13, 2015, 7:06 a.m. OK Java 7 TESTS 17 62 0 2100
7503586 Antoniuk C Aug. 18, 2014, 6:25 p.m. OK Java 7 TESTS 17 62 0 2100
7414784 PlayLikeNeverB4 C Aug. 10, 2014, 3:46 p.m. OK Java 7 TESTS 17 62 0 2100
7294471 upsolving C July 30, 2014, 5:09 p.m. OK Java 7 TESTS 17 62 0 2100
7275120 sousnake C July 28, 2014, 7:28 a.m. OK Java 7 TESTS 17 62 0 2100
7262244 eatmore C July 27, 2014, 5:29 p.m. OK Java 7 TESTS 17 62 0 2100
7486569 DL.Meteor C Aug. 16, 2014, 6:34 p.m. OK Java 7 TESTS 17 77 0 2100
7485775 haminhngoc C Aug. 16, 2014, 4:27 p.m. OK Java 7 TESTS 17 77 0 2100
7302870 master_j C July 31, 2014, 11:04 p.m. OK Java 7 TESTS 17 77 0 2100
7281205 aladdin3 C July 28, 2014, 11:08 p.m. OK Java 7 TESTS 17 77 0 2100
60329682 satya26 C Sept. 10, 2019, 4:59 a.m. OK Java 8 TESTS 17 109 0 2100
14753303 AlexFetisov C Dec. 11, 2015, 6:09 a.m. OK Java 8 TESTS 17 109 0 2100
21120054 Dukkha C Oct. 2, 2016, 4:30 p.m. OK Java 8 TESTS 17 124 0 2100
20766995 MedoN11 C Sept. 20, 2016, 1:51 a.m. OK Java 8 TESTS 17 124 0 2100
7322587 zyt144 C Aug. 1, 2014, 9:41 p.m. OK Java 8 TESTS 17 124 0 2100
7276724 IgorKoval C July 28, 2014, 10:30 a.m. OK Java 8 TESTS 17 124 0 2100
30448324 aabzac C Sept. 17, 2017, 7:36 p.m. OK Java 8 TESTS 17 124 20992000 2100
32342762 Ahmad_Elsagheer C Nov. 15, 2017, 10:14 p.m. OK Java 8 TESTS 17 139 0 2100
7270677 mmaxio C July 27, 2014, 7:43 p.m. OK Java 8 TESTS 17 139 0 2100
56853678 Sharon C July 11, 2019, 5:06 p.m. OK Java 8 TESTS 17 140 0 2100
7339623 gualex C Aug. 3, 2014, 5:21 p.m. OK MS C# TESTS 17 46 2150400 2100
9364321 camypaper C Jan. 5, 2015, 8:11 a.m. OK MS C# TESTS 17 62 0 2100
19198306 vjudge5 C July 18, 2016, 1:33 a.m. OK MS C++ TESTS 17 15 0 2100
19146365 vjudge1 C July 15, 2016, 7:34 a.m. OK MS C++ TESTS 17 15 0 2100
15142865 HappyNewYearMike C Dec. 31, 2015, 10:49 p.m. OK MS C++ TESTS 17 15 0 2100
11988624 pacu C July 9, 2015, 4:57 p.m. OK MS C++ TESTS 17 15 0 2100
11443187 best2you C June 5, 2015, 8:36 a.m. OK MS C++ TESTS 17 15 0 2100
8378063 TahaMahmoud C Oct. 24, 2014, 1:47 p.m. OK MS C++ TESTS 17 15 0 2100
7555502 Gallion C Aug. 22, 2014, 10:10 p.m. OK MS C++ TESTS 17 15 0 2100
7545269 kikosovich C Aug. 21, 2014, 3:53 p.m. OK MS C++ TESTS 17 15 0 2100
7435185 datacw C Aug. 12, 2014, 1:51 p.m. OK MS C++ TESTS 17 15 0 2100
7306317 Carups C Aug. 1, 2014, 9:41 a.m. OK MS C++ TESTS 17 15 0 2100
8346733 desert97 C Oct. 21, 2014, 10:46 p.m. OK Python 2 TESTS 17 46 0 2100
7330359 FIIAurelian C Aug. 2, 2014, 4:37 p.m. OK Python 2 TESTS 17 46 0 2100
7276918 Sergiu C July 28, 2014, 11:01 a.m. OK Python 2 TESTS 17 46 0 2100
7271538 cjoa C July 27, 2014, 8:19 p.m. OK Python 2 TESTS 17 46 0 2100
7271118 llllllll C July 27, 2014, 7:54 p.m. OK Python 2 TESTS 17 61 204800 2100
7271931 kotuxa C July 27, 2014, 9:06 p.m. OK Python 2 TESTS 17 62 0 2100
7270691 nwi C July 27, 2014, 7:44 p.m. OK Python 2 TESTS 17 62 0 2100
7267680 dante1995 C July 27, 2014, 6:38 p.m. OK Python 2 TESTS 17 62 0 2100
7280438 godmar C July 28, 2014, 7:25 p.m. OK Python 2 TESTS 17 139 5529600 2100
11445567 learningmou C June 5, 2015, 11:54 a.m. OK Python 2 TESTS 17 155 5017600 2100
9365565 orailly C Jan. 5, 2015, 12:07 p.m. OK Python 3 TESTS 17 46 0 2100
10911959 CHVRCHES C April 27, 2015, 5:42 p.m. OK Python 3 TESTS 17 46 4608000 2100
7285597 yugle7 C July 29, 2014, 1:56 p.m. OK Python 3 TESTS 17 61 0 2100
30337182 defunator01 C Sept. 14, 2017, 7:13 p.m. OK Python 3 TESTS 17 62 0 2100
22158517 haleyk100198 C Nov. 11, 2016, 6:31 a.m. OK Python 3 TESTS 17 62 0 2100
21888364 Sanae_L C Oct. 30, 2016, 7:49 a.m. OK Python 3 TESTS 17 62 0 2100
21654268 aamine C Oct. 21, 2016, 10:47 p.m. OK Python 3 TESTS 17 62 0 2100
7345717 jebwizoscar C Aug. 4, 2014, 2:23 p.m. OK Python 3 TESTS 17 62 0 2100
7333446 ergatis C Aug. 3, 2014, 1:03 a.m. OK Python 3 TESTS 17 62 0 2100
7292840 Ringod C July 30, 2014, 12:46 p.m. OK Python 3 TESTS 17 62 0 2100
7283301 Lapenkov C July 29, 2014, 8:14 a.m. OK Ruby TESTS 17 46 0 2100
7349116 Chiba C Aug. 5, 2014, 3:29 a.m. OK Ruby TESTS 17 62 0 2100
7301765 scanhex C July 31, 2014, 6:38 p.m. OK Ruby TESTS 17 62 0 2100
35873274 ______u______ C March 3, 2018, 7:28 a.m. OK Ruby TESTS 17 62 6656000 2100
35873054 ______n______ C March 3, 2018, 7:23 a.m. OK Ruby TESTS 17 62 6656000 2100
35872433 _____k_____ C March 3, 2018, 7:10 a.m. OK Ruby TESTS 17 62 6656000 2100
35872420 _____i_____ C March 3, 2018, 7:10 a.m. OK Ruby TESTS 17 62 6656000 2100
35863460 ______k______ C March 2, 2018, 10:47 p.m. OK Ruby TESTS 17 62 6656000 2100
35863445 ______h______ C March 2, 2018, 10:47 p.m. OK Ruby TESTS 17 62 6656000 2100
35862938 ______i______ C March 2, 2018, 10:35 p.m. OK Ruby TESTS 17 62 6656000 2100

remove filters

Back to search problems