cgy4ever's blog

By cgy4ever, history, 3 years ago, , As Errichto suggested here, I will post date/time of upcoming SRMs once I know, and will update it about 24 hours before the contest so it will be in the "Recent Actions" list.

SRM 702 will start on Nov 14 at 9pm EST. Note that Daylight Saving Time will end on Nov 6.

This is the last SRM before Topcoder Open 2016, so please come and compete if you want to practice once more. :)

Update: the contest will start in less than 1.5 hours. Comments (18)
 » Update: SRM 702 will start in 24 hours.
 » Woke up at 5:00 A connection to the server could not be established Will be fun to get this on TCO.
•  » » I'm sorry, looks like my internet provider blocks arena :(
 » How to Solve div2 1000 points problem?
•  » » What I did is as follows :Made a recursive function with memorization (Dynamic Programming), which will return expected value given a subset of block (call it mask) and the face vector.For each subset I calculated the result when a particular faces comes up with probability equal to 1/face.size() and for this face removed a subset, which sums to the number on this face, from mask, which will be most favorable (meaning which enable us create most of the numbers on the faces after removing the face).I am NOT passing all testcases with this approach. Passing 6 out 7 given test cases.Can anyone please explain where I am going wrong ?Here is my code if you would like to have a look : #include #include #include #include #include using namespace std; int test = 0; class SubsetSumExtreme{ public : int subset; int perms; double dp; double getExpectation(vector block, vector face, int mask){ if(dp[mask]!=-1.0) return dp[mask]; double ans = 0.0; double n = (double)(face.size()); int len_block = block.size(); for(auto f : face){ map < int, vector > mp; for(int i = 0; i<(1<second){ ans += getExpectation(block,face,mask-p)/n/mp.rbegin()->second.size(); } }else{ double z = 0.0; for(int i = 0; i<(len_block); i++){ if(mask & (1< block, vector face){ sort(face.begin(),face.end()); sort(block.begin(),block.end()); int len_block = block.size(); for(int i = 0; i<(1<
•  » » I didn't understand the problem , didn't get the part about finding the minimum expected score . Can someone explain why the answer for {1,2,1} , {1,2} is 0.5 ?