1 / 4
Oct 2014

Your algorithm is O(n^3). With n being as large as 10000 that's far too slow. Do you really need all three loops?

i think 3 loops are required. what else can be done?

You will not get AC with three loops smile
You must figure that out on your own, that is the whole difficulty of the problem.

Suggested Topics

Topic Category Replies Views Activity
C and C++ 0 14 7d

Want to read more? Browse other topics in C and C++ or view latest topics.