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

How to count?
Posted by Pier Paolo Guillen Hernandez 1 Dec 2002 08:08
  Any hint on how to count all relations?

    Thanks!
Re: How to count?
Posted by Dilyan 1 May 2005 15:55
use DP. your function will be F(n, k) where N is the amount of number in the relation and K is the number of groups.
For example:
a=b=c=d - 1 group
a=b<c=d - 2 groups
a<b<c<d - 4 groups

equal numbers form one group.

Edited by author 09.05.2005 05:40
Re: How to count?
Posted by zeroh 28 Jan 2008 07:01
It's a maths problem. Like that puting N balls into M boxes.

Edited by author 28.01.2008 07:01
Re: How to count?
Posted by Taras Vasylyshyn 26 Jul 2010 16:31
Thank you! The idea of puting balls into boxes helped me.