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 1169. Pairs

weak tests
Posted by morbidel 13 Jul 2011 21:20
I got AC with a somehow optimized backtracking that generated partitions for N. When I reached a partition with K critical edges -> solution. But with a value of K well chosen (maximum K for which we do not have all pairs critical) this approach should TLE.
Test is N = 100, K = 4947
Re: weak tests
Posted by Sandro (USU) 14 Jul 2011 14:59
Your test was added.
Re: weak tests
Posted by morbidel 14 Jul 2011 15:34
Finally AC, very nice problem! Replaced the backtracking with a recursive formula, used also the first two of the Viete relations.

Edited by author 14.07.2011 19:33