Search found 9 matches

by sitz
Wed Mar 23, 2011 5:32 pm
Forum: Volume 108 (10800-10899)
Topic: 10883 - Supermean
Replies: 30
Views: 12277

Re: 10883 - Supermean

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)C1 * a...
by sitz
Fri Mar 18, 2011 5:34 pm
Forum: Volume 8 (800-899)
Topic: 821 - Page Hopping
Replies: 5
Views: 5639

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 #include ...
by sitz
Sat Oct 30, 2010 10:44 am
Forum: Volume 118 (11800-11899)
Topic: 11838 - Come and Go
Replies: 22
Views: 8118

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
by sitz
Fri Oct 01, 2010 2:48 pm
Forum: Volume 118 (11800-11899)
Topic: 11838 - Come and Go
Replies: 22
Views: 8118

Re: 11838 - Come And Go

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

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 its ...
by sitz
Tue Sep 28, 2010 11:50 pm
Forum: Volume 118 (11800-11899)
Topic: 11838 - Come and Go
Replies: 22
Views: 8118

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 ?
by sitz
Thu Sep 23, 2010 1:25 pm
Forum: Volume 118 (11800-11899)
Topic: 11847 - Cut the Silver Bar
Replies: 11
Views: 4719

Re: 11847 Cut the Silver Bar

Is the solution really log2(n) as I keep on getting WA applying the same algorithm :o
Or please provide some critical test cases

Thanx :)
by sitz
Mon Sep 20, 2010 9:08 pm
Forum: Volume 118 (11800-11899)
Topic: 11838 - Come and Go
Replies: 22
Views: 8118

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 w...
by sitz
Mon Sep 20, 2010 1:40 am
Forum: Volume 118 (11800-11899)
Topic: 11838 - Come and Go
Replies: 22
Views: 8118

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 <map> ...

Go to advanced search