OK, great. I guess CommonLounge has evolved a lot from the last time I opened it.
OK, great. I guess CommonLounge has evolved a lot from the last time I opened it.
If you want to use Java, be prepared for lots of optimisation, Java has a much bigger library than C++, but that also makes it take a bit more time and memory.
Optimisations you probably need for contests
Don't use hundereds of defines, ifdefs, ifndefs; to confuse your preprocessor and more importantantly confuse yourself at times.
I don't prefer pointers at all. Look up Row Major Order and Column Major Order possibly for address calculation.
Doing that in centre isn't that easy especially if you aren't allowed to do that and you don't know using Ubuntu except for a bit of the the BAsh.
I found yesterday that both my original programs gave the correct output at least on the given testcases; had I not tried to edit them to be able to compile on that machine, and fail at it to get a zero possibly by some CE or other error as a result. Will also post my code after 31st to help me figure out if I was wrong somewhere in my logic.
What's worse is ending up with nothing despite having figured out the correct strategy.