ghost_9's blog

By ghost_9, history, 18 months ago, In English
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.

Full text and comments »

  • Vote: I like it
  • -6
  • Vote: I do not like it

By ghost_9, history, 21 month(s) ago, In English

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!!

Full text and comments »

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