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

×

What is wrong with the code for the given problem (Link)?

Here is the link of the question Boredom (Div 1)
and here is my implementation Ideone Link
Can you please spot the error? It is a very short code. Thanks :)

asked 28 Feb '17, 19:56

c0d3h4ck3d's gravatar image

4★c0d3h4ck3d
11918
accept rate: 0%


Your code is accepted now.

Check my submission. Just did slight modification in your code.

Actually you are using int and i*cnt[i]+arr[i-2] can exceed range of int so just replace int with long long and get Accepted.

http://ideone.com/xkZppK

link

answered 28 Feb '17, 20:38

inovation123's gravatar image

3★inovation123
4537
accept rate: 10%

edited 28 Feb '17, 20:50

Oh, silly me. Thanks @inovation123 :)

(01 Mar '17, 09:04) c0d3h4ck3d4★
toggle preview
Preview

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:

×2,170
×682

question asked: 28 Feb '17, 19:56

question was seen: 302 times

last updated: 01 Mar '17, 12:53