Page 2 of 2

Re: 440 TLE?

Posted: Mon May 26, 2008 11:48 am
by Obaida
I have seen the ranking is 0.000 for this program. But my one is very slow :( !!!
I made a normal simulation to calculate the value. Is there any trick to find the value.
I hate such slow codes. :x

440 - Eeny Meeny Moo

Posted: Fri Nov 20, 2009 11:26 pm
by mostafa_angel
I read question but I can not realize test cases with the difinition...
we must find the m that the Ulm city selected as the last city. but in the second test case for n = 4 the answer is m = 5
so the sequence is = {1 ,2 , 3 , 4 , 5}
Ulm is not the last one !!!!!

Re: 440 TLE?

Posted: Thu Jun 16, 2011 7:56 pm
by plamplam
This is how you can get this code done in very short time. When I submitted this code for the first time, I got AC :D, but the runtime was 0.904 seconds. Then I realized that 3<=n<=150, and an idea suddenly struck my head. I removed scanf("%d",&n);
and the for loop was replaced with for(n = 3; n < 150; n++) from my original code. After I calculated the result, I simply printed printf("if(n == %d) printf("%d\n");", n, result); and copied the printed lines from the terminal and pasted them. I got AC in 0.08 seconds :D. It is impossible to get 0.000 runtime nowadays, it sucks lol.
Note you need to add an escape character before " and \n in order to print them. And try to find an optimized solution before you do this. But we all know that everything is fair in war and programming :wink:

Re: 440 - Eeny Meeny Moo

Posted: Sat Sep 22, 2012 8:37 pm
by renatov
For example, N = 10, M = 3, considering "1" as the first selected city:

Code: Select all

1	2	3	4	5	6	7	8	9	10
2	3	4	5	6	7	8	9	10	
2	3	5	6	7	8	9	10		
2	3	5	6	8	9	10			
2	3	5	6	8	9				
2	3	6	8	9					
2	3	6	8						
2	3	8							
2	8								
2