You are not logged in. Please login at www.codechef.com to post your questions!

×

[closed] How to solve Topcoder SRM 536 Div 1 Medium?

0
1

During the SRM, I coded the following approach:

If the array consists of (n - 1) ones then return n. Otherwise just sum the expected value of each of the dice and round down to the nearest integer. This cleared the examples. As I could not find any case which broke the code, I submitted it. What is wrong with the approach and what is the correct approach? I tried reading others' code but could not understand the logic.

The problem statement: http://community.topcoder.com/stat?c=problem_statement&pm=11797&rd=14728

My (wrong) solution: http://community.topcoder.com/stat?c=problem_solution&rm=311909&rd=14728&pm=11797&cr=22781250

asked 15 Mar '12, 17:27

balajiganapath's gravatar image

6★balajiganapath ♦♦
75542742
accept rate: 77%

closed 16 Mar '12, 19:14

The question has been closed for the following reason "Because the editorial is available now." by balajiganapath 16 Mar '12, 19:14

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported
  • mathemetical formulas in Latex between $ symbol

Question tags:

×195

question asked: 15 Mar '12, 17:27

question was seen: 2,162 times

last updated: 16 Mar '12, 19:14