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 1606. Slalom

How many test cases are there?
Posted by obtuseSword 7 Mar 2008 09:50
I've got TLE at Test#10,so I want to know how many test cases there are.
If there are only near 10 cases,I'll improve on my program,or else,I'll give it up.
Who can help me?
Re: How many test cases are there?
Posted by Vedernikoff Sergey 7 Mar 2008 16:22
I suppose there are much more than 10 testcases. My solution works about 0.1 sec on any test, so timelimit is quite enough. Try to create quicker algo...
Re: How many test cases are there?
Posted by obtuseSword 11 Mar 2008 13:12
Thank you.
I've found that greedy algorithm can solve this problem,thus no longer need dynamic progrmming.
And I've got AC.
Re: How many test cases are there?
Posted by igaoxiang 13 Mar 2008 16:58
Can you tell me your greedy algorithm?
Re: How many test cases are there?
Posted by Chmel_Tolstiy 13 Mar 2008 19:21
Greedy? Please tell us your idea.
Re: How many test cases are there?
Posted by svr 13 Mar 2008 19:52
I think that "greedy" here is terminologic mismatch.
Right termin is "simple constructive" algo.
Candidat to optimum easy to find simply  tracing
trajectory of all points sorted by y- coordinate.
Re: How many test cases are there?
Posted by Vedernikoff Sergey 14 Mar 2008 17:29
Not mismatch at all. The simplest way to solve the problem is to find a greedy algo.
Re: to find a greedy algo
I solved it with DP+date structure like "the stars" task.
0.578 sec, 44 896 КB...

How to solve it with greedy algo?
Re: to find a greedy algo
Posted by Nguyen Dinh Tu (DHSP) 19 Apr 2008 00:28
Data structure i used is Binary Index Tree