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

×

[closed] MAXCOUNT WA

For the problem MAXCOUNT, the code below gives Wrong answer. Kindly explain the error.

http://www.codechef.com/viewsolution/3661072

asked 31 Mar '14, 15:22

sandy999's gravatar image

2★sandy999
39111638
accept rate: 10%

closed 18 Jan '15, 12:55

The question has been closed for the following reason "The question is answered, right answer was accepted" by sandy999 18 Jan '15, 12:55


The suggestion given by @asimali246 is absolutely correct. Check the link of the accepted solution below :

http://www.codechef.com/viewsolution/3661615

I have made the three changes to your solution 1st the array size to 10^5+1 , loop upto 10^5 and the last loop upto 10^5 as suggested by @asimali246 .

link

answered 31 Mar '14, 20:35

vermashubhang's gravatar image

5★vermashubhang
1.5k11025
accept rate: 23%

You have created an array(counter) of size 10000, you need to create it of 10000+1=10001 as the inputted number can be 10000 also. Also you need to run your loop till 10000 rather than less than 10000.

link

answered 31 Mar '14, 16:42

asimali246's gravatar image

4★asimali246
14125
accept rate: 40%

edited 31 Mar '14, 17:22

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:

×21
×2

question asked: 31 Mar '14, 15:22

question was seen: 506 times

last updated: 18 Jan '15, 12:55