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

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

Hi guys, I've been trying the Gym labeled as 2018 UCP-ICMC and I am getting stuck with problem F, I cannot even pass the test 7.

To summarize, what I did was to identify what are the integers that all friends who listed what numbers their like, are in common. So, if 5 friends with a set of integers A, B, C, D, E look for the intersection of A, B, C, D & E. Finally, since the rest of friends just mentioned what numbers their hate (assuming what they did not mention are numbers they like), I just remove all integeres that were listed as 'hated' from the intersection of sets I had.

So my final answer ended up being something like |U| — |H|, where U is the set resulting from Union of the intersection of all integers listed as 'liked' and all integers listed as 'hated' and H is the set of hated integers (here all items 'liked' but 'hated' by others will be not taken into account).

Here is the appoach mentioned above: https://ideone.com/FQnNov Here is the latest attempt I did that ended up in same result: https://ideone.com/u9PU7m

This is the problem I am trying to deal with: http://codeforces.me/gym/101875/problem/F

I would appreciate your guidance, help, suggestions, pretty sure it will help me a lot :)

Thanks in advance!

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

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

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

Hi everyone! Today I was looking for a way to solve de LCS (Longest Common Subsequence) problem for n strings and I found a curious comment of a member saying that this problem can be reduced to a Vertex Cover. Could someone please help me explaining how to do it?

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

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

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

Hi guys! Can someone explain me please, how to use BIT in this problem? http://codeforces.me/problemset/problem/12/D I've seen that some contestants has solved it using BIT but I didn't understand how they do. Thanks in advance! :)

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

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