shaw_off's blog

By shaw_off, history, 6 weeks 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

»
6 weeks ago, # |
  Vote: I like it +5 Vote: I do not like it

Let me suggest a good tutorial for this topic.

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

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

»
6 weeks 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.