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 1208. Legendary Teams Contest

So easy.
Posted by Ayhan Aliyev [BOTL] 9 Feb 2006 22:51
Don't spend your time searching a fast algorithm.
Simple recursive solution which searchs all possible answers gets AC 0.015!!
Re: So easy.
Posted by Alexey 18 Jun 2006 00:23
Yeah, but I have TLE#7!
Re: So easy.
Posted by Ayhan Aliyev 19 Jun 2006 13:30
Firstly I made a table that shows which team can't participate with which one and then used recursion to compute answers.
Note that order of teams does not matter. Choosing teams numbered 2,3 is same as choosing  3, 2 so try to choose teams in increasing odrer.
I hope that it will help you
Re: So easy.
Posted by Kolyanich 27 Dec 2010 13:14
I'd simply bruteforced it and used DP approach. AC in 0.156 sec on worst test. There are only 18 teams, so we can iterate over all possible 2^18 combinations and store "useful information" from previous iterations in large array. All done with bitmasks