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

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

Hi. I tried to solve this problem: NKMARS . My aproach is: Use sweepline algorithm, sort the events in opening vertical segments and closing vertical segments. Then for each value of X, add the current area to the answer and update the current 'window' of active segments in Y coordinate(from the left to the right). I think that a Segment Tree with lazy propagation must be useful here. But I dont know what data I would save for a single node in the Segment Tree. Can anyone help me? thanks in advance (Sorry for my poor english).

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

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

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

Hi... I am trying to solve this problem

I learned about Ternary Search and my code works for the test cases in the sample. Can anyone tell me some hint? this is my code Thanks in advance and sorry for my poor english

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

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

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

Hi, I learned about modular multiplicative inverse with modulo M (M is a prime number) using: (a^(M-2) ) MOD M

Now I would like to learn how calculate modular multiplicative inverse with modulo no prime.

Could someone give me one or two examples how to calculate it? For example COMB(8,3) = 8! /(3! * (8-3)!) = 56 , then COMB(8,3) MOD 6 = 2.

Thanks in advance. (Sorry for my poor english)

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

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

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

I would like to have help learning Dynamic Programming, since the subject is unknown at my university, but I like to solve programming problems in online judges, and I would like to continue learning.

I have read about DP on sites like TopCoder. After think a lot I could solve the knapsack problem 0-1, the problem of coins, and others ... anyone know of similar problems? to begin improving in DP. Sorry for my poor English. Thanks in advance...

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

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