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

Автор ghost_9, история, 18 месяцев назад, По-английски
void solve()
{
  int *a = (int*)malloc(1000000000*sizeof(int));//case 1
 
  cout<<1<<endl;
  return;
}

So recently I was asked a question? Why this code compile and does not give RTE, it had to do something with virtual memory if you use a vector array instead it will provide bad_alloc as RTE. So what is the reason behind it or is it compiler dependent?

But the hint was to think about how virtual memory can be used here.

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

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

Автор ghost_9, история, 21 месяц назад, По-английски

So in the recent contests and tests, I felt that I lost more points by making silly mistakes. I feel that increasing my ability to focus will help me improve.

But how to do so???

  • I tried high-intensity exercises before 1-1.5 hrs of a contest (doesn't seem to help at all).
  • I have tried to follow a good sleep schedule (helps but I failed miserably to follow it for more than 2 days).

So I wanted to ask about the practices you people use while practicing and before a contest.

Thanks!!

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

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