Bit-Ghifo's blog

By Bit-Ghifo, history, 15 months ago, In English

I got runtime error when using this custom compare function:

bool cmp(char& a, char& b){
	return id[a - 'a' + 1] >= id[b - 'a' + 1];
}

when I changed it to:

bool cmp(char& a, char& b){
	return id[a - 'a' + 1] > id[b - 'a' + 1];
}

I got AC.

does anyone know why did that happen?

lucky for me this didn't happen in a contest.

Full text and comments »

  • Vote: I like it
  • +3
  • Vote: I do not like it