NOTHING

NOTHING HERE :P

Last edited on
I am not able to optimize this code for large n. ...
What should I do??
Hello minimum,

You made an attempt for code tags, but HTML style tags do not work.


PLEASE ALWAYS USE CODE TAGS (the <> formatting button), to the right of this box, when posting code.

Along with the proper indenting it makes it easier to read your code and also easier to respond to your post.

http://www.cplusplus.com/articles/jEywvCM9/
http://www.cplusplus.com/articles/z13hAqkS/

Hint: You can edit your post, highlight your code and press the <> formatting button.
You can use the preview button at the bottom to see how it looks.

I found the second link to be the most help.



<bits/stdc++.h> is not a standard C++ header file and it makes it difficult to compile or run the program with a file that most people do not have.

I do not mean to be rude and do not take this the wrong way, but optimizate is not a proper word and I am not sure what yo are looking for.

Along with the proper code tags and indenting a fwe blank lines would help to make the code easier to read.

Hope that helps,

Andy
no here by optmizing I mean that ... I have to reduce time complexity of the code and what should I do for that
Throw the code away, and think of a better ALGORITHM.

Your code, as it stands is like a bubble sort. Quick, dirty, but hopeless with large data sets.
https://en.wikipedia.org/wiki/Sorting_algorithm

You need to THINK much smarter about the problem.

You won't get there by tinkering with the code you have.

would you please optimize my code
You haven't told us what it's supposed to do.

You've presented us with a model-t ford.

There's no point making it go as fast as a ferrari only for you to turn round later and say it needs wings.

And no, we're not here to fix whatever half-baked idea you come up with just for you to earn brownie points in some competition.
With an attitude like that nothing is what you will get in abundance.

Reporting the one person trying to help you is the wrong approach. You may not have liked salem c's answers, but his point was to try and get you to think about some different in how the program could work.

Andy
It looks like the code was optimised by deleting it.
At least it runs in zero time now - can't get more efficient than that.

Open your eyes, people.
@minimum is obviously a troll.
Couldn't be more obvious.

Anyway, in future if someone responds to this type of question, they should start (or end) their post with a copy of the question. That way it can't be deleted.
Last edited on
That way it can't be deleted.
Can't we just use our superior programmer powers and 1.2.3. Sorted?
Topic archived. No new replies allowed.