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

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

Given an array A of N elements representing the monsters and an array B of Q elements representing the heros.

The i-th type of monster is represented by A[i][0], A[i][1], and A[i][2] which means a monster of the i-th type is present at each integer co-ordinate from A[i][0] to A[i][1] and having a strength of A[i][2].

The i-th type of hero is represented by B[i][0] and B[i][1] which means a hero of strength B[i][1] will appear at the integer point B[i][0] after i seconds. When the i-th hero appears it will destroy each and every monster present at B[i][0] and having a strength less than B[i][1].

For each i you have to determine the number of monsters left after the i-th hero has completed their task.

Constrains:

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

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

Автор shyam1909, история, 3 года назад, По-английски

I was solving this problem problem .I encountered a problem while inputting the string . In my first submission i used scanf("%s",arr) which resulted in WA. Then i changed the input method to cin >> arr , then the submission became AC. Submission using scanf -> scanf Submission using cin -> cin

Submission using scanf() worked fine in my pc, but not in codeforces.

Can someone help me why does scanf() doesn't work here? Thanks in advance :)

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

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