ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1142. Relations

combinatorics
Posted by staticor 4 Jul 2013 20:32
use DP, mainly involved with:
  permutation  and  combination
A(n,k)
C(n,k)

or, you can think about there is a x-Axis.

two points (a, b)  can be placed  --a--b--    --b--a--  ||  --(ab)--    the first two solution has two groups, and the last one has one groups for the overlap.