Search found 100 matches
well , my AC code does not output the same as Rio's one for the inputs of <:3)~~ .I think there can be more than one solutions...but I wonder how is it possible as the told to output the lexicographically smallest one to print ... and my output mismathes Rio's out put for the second input (all 0) an...
Is there anyone who can explain the algorithm for this problem ?? I think , I have to calculate repeatedly changing source and sink and then pick the smallest flow. but I am a bit confused how to construct the graph and how to select the source and the sink . Can anyone help me ??
- Thu Aug 23, 2007 4:10 pm
- Forum: Volume 8 (800-899)
- Topic: 820 - Internet Bandwidth
- Replies: 43
- Views: 20517
well , I think its a straight-forward ford-fulkerson algo implementation . I considered bi-directional case and also the case of multiple edges between two nodes. Still I am getting WA. Here is my code. Any tricky input to produce wrong answer here ??
Code: Select all
removed after ACC
I am a bit confused with the problem statement . Can a bank be robbed more than once ?? If a bank is being robbed for the second time , doest it men that the second robbers are crossing the first robbers' path ?? I am getting WA . I used backtracking to match the paths . I got correct answer for the...
I am really very much astonished with the behaviour of double in C. double x = 5.10 x*=100; printf("%0.lf",x); and u will get 5.09 !!! this is just horrible ...I thought , this floating point error is not there in double precision which was in the float data type. But it exists even in Long double ....
- Tue Aug 14, 2007 8:51 pm
- Forum: Volume 2 (200-299)
- Topic: 259 - Software Allocation
- Replies: 28
- Views: 10542
well I tried here bipartite matching .... my code ran well for all the input I gave . But i dont know why it is gettin RUNTIME ERROR(invalid memory reference) in UVA judge :( can anyone help me ?? here is my code .. #include<cstdio> #include<iostream> #include<cstring> using namespace std; int a[300...
- Sun Jul 29, 2007 8:22 pm
- Forum: Volume 106 (10600-10699)
- Topic: 10679 - I Love Strings!!
- Replies: 101
- Views: 48026
My KMP failed with TLE. So, whats the trick?? any optimization upon the KMP or any new algorithm . I found Krugel and Sajjad bhai suggested two different new algorithm . But The r not assymtotically faster than KMP. Infact according to Cormen, KMP is the optimal algorithm for String matching. Is the...