Re: [algogeeks] Re: SPOJ:RRSCHED

2010-06-21 Thread Terence
Don't try to simulate the scheduler on every second. The total execution time can reach 5 * 10^9 sec. Play with small examples, get the task list in execution order, and find the cyclic property of the list. You can solve this problem in O(N) time complexity. On 2010-6-20 18:15, Shravan

Re: [algogeeks] Re: SPOJ:RRSCHED

2010-06-20 Thread Rohit Saraf
You must be doing some useless iterations . Otherwise, TLE is too strange for this prob. -- Rohit Saraf Second Year Undergraduate, Dept. of Computer Science and Engineering IIT Bombay http://www.cse.iitb.ac.in/~rohitfeb14 On Sat, Jun 19, 2010 at

[algogeeks] Re: SPOJ:RRSCHED

2010-06-20 Thread Shravan
Did you see the code which I have posted. On Jun 20, 2:31 pm, Rohit Saraf rohit.kumar.sa...@gmail.com wrote: You must be doing some useless iterations . Otherwise, TLE is too strange for this prob. -- Rohit Saraf Second Year Undergraduate,

Re: [algogeeks] Re: SPOJ:RRSCHED

2010-06-20 Thread Rohit Saraf
No -- Rohit Saraf Second Year Undergraduate, Dept. of Computer Science and Engineering IIT Bombay http://www.cse.iitb.ac.in/~rohitfeb14 On Sun, Jun 20, 2010 at 3:22 PM, Shravan shravann1...@gmail.com wrote: Did you see the code which I have

[algogeeks] Re: SPOJ:RRSCHED

2010-06-18 Thread Shravan
Even I have implemented it using arrays, but I am getting a TLE. Here's the code http://ideone.com/EfYRa On Jun 19, 8:15 am, Anand anandut2...@gmail.com wrote: It can be done using simple array data structure why do we need complex data structure. Here is how I did. Let me know if I