Hi!
I tried this problem with algorithm mentioned here: http://www.algorithmist.com/index.php/UVa_10883
which is: ((n-1)C0 * a1 + (n-1)C1 * a2 + .....+(n-1)Cmid-1 * a mid + ... + (n-1)C0 * an) / 2 ^ (n-1)
As we have nCr = nCn-r , so, i just modified the algorithm to this:
((n-1)C0 * a1 + (n-1 ...
Search found 9 matches
- Wed Mar 23, 2011 5:32 pm
- Forum: Volume 108 (10800-10899)
- Topic: 10883 - Supermean
- Replies: 30
- Views: 17502
- Fri Mar 18, 2011 5:34 pm
- Forum: Volume 8 (800-899)
- Topic: 821 - Page Hopping
- Replies: 5
- Views: 6635
Re: 821 - Page Hopping
Don't know, Its such an easy problem. But, still not able to get AC in it :(
O tries Floyd but, it timed out and now I've tries with BFS but, still no luck. Getting TLE for long time! Please guide me, if any problem is there with my code?
Or, I how can I refine my algorithm ?
Regards,
SITZ ...
O tries Floyd but, it timed out and now I've tries with BFS but, still no luck. Getting TLE for long time! Please guide me, if any problem is there with my code?
Or, I how can I refine my algorithm ?
Regards,
SITZ ...
- Sat Oct 30, 2010 10:44 am
- Forum: Volume 118 (11800-11899)
- Topic: 11838 - Come and Go
- Replies: 22
- Views: 11256
Re: 11838 - Come And Go
Well, You can simply use Floyd-Warshall to get AC in this question, that will suffice for it 
Regards,
SITZ

Regards,
SITZ
- Fri Oct 01, 2010 2:48 pm
- Forum: Volume 118 (11800-11899)
- Topic: 11838 - Come and Go
- Replies: 22
- Views: 11256
Re: 11838 - Come And Go
Well, I thought the same way, but, actually it did pass 
For ur belief you can check the verdict of judge here : http://felix-halim.net/uva/hunting.php? ... hrivastava

For ur belief you can check the verdict of judge here : http://felix-halim.net/uva/hunting.php? ... hrivastava
- Fri Oct 01, 2010 2:20 pm
- Forum: Volume 118 (11800-11899)
- Topic: 11838 - Come and Go
- Replies: 22
- Views: 11256
Re: 11838 - Come And Go
Hi Igor9669 !
But, I don't understand how people can't understand the simple question that I have posted here :(
I said I have got Accepted with a time of around 0.338 s using Floyd-Warshall Algorithm...
I just wanted to ask if the above implementation using queues can be optomized to get Ac or ...
But, I don't understand how people can't understand the simple question that I have posted here :(
I said I have got Accepted with a time of around 0.338 s using Floyd-Warshall Algorithm...
I just wanted to ask if the above implementation using queues can be optomized to get Ac or ...
- Tue Sep 28, 2010 11:50 pm
- Forum: Volume 118 (11800-11899)
- Topic: 11838 - Come and Go
- Replies: 22
- Views: 11256
Re: 11838 - Come And Go
@Shafeet_du : My TLE code (given above) aslo gives the same outputs...
But, can we do it the way I have done it ? Or, not ?
But, can we do it the way I have done it ? Or, not ?
- Thu Sep 23, 2010 1:25 pm
- Forum: Volume 118 (11800-11899)
- Topic: 11847 - Cut the Silver Bar
- Replies: 11
- Views: 5808
Re: 11847 Cut the Silver Bar
Is the solution really log2(n) as I keep on getting WA applying the same algorithm
Or please provide some critical test cases
Thanx

Or please provide some critical test cases
Thanx

- Mon Sep 20, 2010 9:08 pm
- Forum: Volume 118 (11800-11899)
- Topic: 11838 - Come and Go
- Replies: 22
- Views: 11256
Re: 11838 - Come And Go
As I told before... I know that it can be solved by standard graph algorithm and, I have done it too with "Floyd-Warshall" Algorithm.
But, can anyone tell me is it possible to do the same by QUEUE implementation as in my above code ?
And if yes, then where is the problem in my code... It gives TLE ...
But, can anyone tell me is it possible to do the same by QUEUE implementation as in my above code ?
And if yes, then where is the problem in my code... It gives TLE ...
- Mon Sep 20, 2010 1:40 am
- Forum: Volume 118 (11800-11899)
- Topic: 11838 - Come and Go
- Replies: 22
- Views: 11256
11838 - Come and Go
Hi All !
I was trying this question from the Brazilian Contest. Though, it seems to be standard Floyd-Warshall Algorithm, I was using simpler queue implementation.
I think my approach is correct, but, getting TLE :( Any reasons for TLE in this code :
#include <vector>
#include <list>
#include ...
I was trying this question from the Brazilian Contest. Though, it seems to be standard Floyd-Warshall Algorithm, I was using simpler queue implementation.
I think my approach is correct, but, getting TLE :( Any reasons for TLE in this code :
#include <vector>
#include <list>
#include ...