Hi everyone!. Im stuck with a bug in this problem. I tried to debug it, the code gets a runtime error in the cin>>buff line, when trying to get the last number (n=1999, and runtime error at i=1998). I will be glad if you can help me. Thanks!!!
My Submission: 123961933
Problem: 1546C — AquaMoon and Strange Sort
The comparison function of sort must be a strict order : It must return false when x = y. Replacing > with >= gives AC.
WoW thanks mate!!. I still dont understand well. I put couts in the code to debug it, and i was sure that it stopped in the cin. That was incorrect? or was de comp function messing the things?. Other question, the sort function, swap items when the comp return true? or when return false? Im a bit confused with that. Have a nice day!
Remembers me of this. From what i know the reason for that going terribly wrong is that the way they check if a and b are equal is by seeing if cmp(a,b) and cmp(b,a) both return false.