Блог пользователя 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.net/gym/101875/problem/F

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

Thanks in advance!

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

»
6 лет назад, # |
Rev. 4   Проголосовать: нравится 0 Проголосовать: не нравится

It seems that your solution is missing the boundary case when t = 2 for all persons. In such case, the answer should be

1018 -  total_count( disliked numbers ).

Check the last statement in the following submission for more details. 44991896