Пожалуйста, прочтите новое правило об ограничении использования AI-инструментов. ×

Блог пользователя rtanmay

Автор rtanmay, история, 6 лет назад, По-английски

Hello,

I was solving this problem. In this I have sorted the array of structures.

//This is my structure:
typedef struct node
{
	int a,b,c;
} node;

Submission

//This gets runtime error on test-32.
//Error: comparison doesn't meet irreflexive requirements, assert(!(a < a)).
bool compare(node n1, node n2)
{
	if(n1.c > n2.c) return false;
	else return true;
}

Submission

//However this gets accepted, only change is in >=
bool compare(node n1, node n2)
{
	if(n1.c >= n2.c) return false;
	else return true;
}

Why is this error coming? I thought even if we give only > then for equal value it will return true, so there should not be any problem between comparison of equal elements.

Thank you

Полный текст и комментарии »

  • Проголосовать: нравится
  • -5
  • Проголосовать: не нравится

Автор rtanmay, 6 лет назад, По-английски

Hello,

When using half screen for Codeforces and half for text editor, I am not able to view the complete submissions. The submission can be scrolled right but not left.

This is how it looks.

Is this a bug or am I operating the website incorrectly?

The problem persists after opening the window in full screen (from half screen), so the submission has to be opened again. This is how it looks after opening the window in full screen (from half screen)

Полный текст и комментарии »

Теги bug
  • Проголосовать: нравится
  • +10
  • Проголосовать: не нравится