×

# TLE in OJUMPS

 0 hey i'm getting TLE in ojumps and i cannot find the problem in the code pls help . the question is http://www.codechef.com/problems/OJUMPS the code is....... inp = int(raw_input()) i = 1 y = 0 p = 0 while y<=inp: if y==inp: print "yes" p = 1 break y = y + i if i==3: i = 0 i+=1 if p==0: print "no"  thank you :) asked 24 Jul '14, 22:18 3★dpmittal 26●1●1●5 accept rate: 0%

 1 The constraints on a (inp in your solution ) are a<= 1018 Your solution is of O(a) complexity. So, it will not pass the test cases in the time limit specified. Try some other logic. You can refer to the editorial : http://discuss.codechef.com/questions/42547/ojumps-editorial If you still have any problem, comment below. answered 24 Jul '14, 22:28 1.8k●4●9●32 accept rate: 14%
 toggle preview community wiki:
Preview

By Email:

Markdown Basics

• *italic* or _italic_
• **bold** or __bold__
• 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:

×717
×122

question asked: 24 Jul '14, 22:18

question was seen: 937 times

last updated: 24 Jul '14, 23:02