lllAlonsolll's blog

By lllAlonsolll, history, 6 years ago, In English

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://mirror.codeforces.com/gym/101875/problem/F

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

Thanks in advance!

Full text and comments »

  • Vote: I like it
  • 0
  • Vote: I do not like it

By lllAlonsolll, history, 9 years ago, In English

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?

Full text and comments »

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

By lllAlonsolll, history, 9 years ago, In English

Hi guys! Can someone explain me please, how to use BIT in this problem? http://mirror.codeforces.com/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! :)

Full text and comments »

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