cosmere's blog

By cosmere, history, 3 years ago, In English

I am trying to solve this problem. The editorial for this problem uses the following approach

Can anyone explain me the Inclusion-Exclusion formula shown here?

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

»
3 years ago, # |
  Vote: I like it +5 Vote: I do not like it

Let me suggest a good tutorial for this topic.

https://mirror.codeforces.com/blog/entry/64625

Once you understand the tutorial, the problem should become easier :)

»
3 years ago, # |
  Vote: I like it -8 Vote: I do not like it

lol, that is the exact same problem as https://dmoj.ca/problem/acc7p4. I copy pasted my code and passed.