×

# alternative for nested loops in c

 0 if there any alternative for nested loops to reduce execution time? This question is marked "community wiki". asked 08 Jun '14, 22:00 16●4●5●11 accept rate: 0%

 0 different Algorithm. answered 08 Jun '14, 22:05 3★s1h33p 329●2●3●9 accept rate: 15%
 0 that is what i asked sir, answered 08 Jun '14, 22:09 16●4●5●11 accept rate: 0%
 0 You can come up with different alternatives for different questions. For exempting loops, you need to think differently about the problem. A good approach would be: Write down the possible test cases (mainly boundary cases). Write down the outputs for them that you get by simply solving the problem mathematically. Try finding out a relation between the noted inputs and their corresponding outputs (there definitely is one alternative if you're getting TLE by naive approach). Try this thing for the problem and you will hit a super simple relation between the inputs and outputs. link This answer is marked "community wiki". answered 08 Jun '14, 22:47 553●1●9●23 accept rate: 5%
 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:

×1,491
×191

question asked: 08 Jun '14, 22:00

question was seen: 7,261 times

last updated: 08 Jun '14, 22:47