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

×

Whats Wrong with my code in HMAPPY2

Can somebody tell me what is wrong with my code for the problem HMAPPY2 in FEB19? I am really not able to figure out why its showing wrong answer. Please help! My code is as shown below :

http://cpp.sh/3d4n2

asked 15 Feb, 18:09

chikkuttan's gravatar image

1★chikkuttan
22
accept rate: 0%

edited 15 Feb, 18:25


All it has to do is with constraints if you look at constraints n <= 10^18 and time provided is 1 sec. So you cannot perform linear traversing. Try to solve it mathematically, if after a lot of tries you cannot solve take a look at my code(Python) - https://www.codechef.com/viewsolution/22736696
c++ code: https://www.codechef.com/viewsolution/23092184

link

answered 15 Feb, 20:36

ayush4's gravatar image

3★ayush4
163
accept rate: 10%

edited 15 Feb, 21:03

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:

×189
×5

question asked: 15 Feb, 18:09

question was seen: 95 times

last updated: 15 Feb, 21:03