Here is my code in Pascal
[pascal]
const maxn=52;
var a:array [0..maxn,0..maxn] of boolean;
c:array [0..maxn,1..22] of boolean;
m,n,i,j,k,p,q:integer;
Begin
readln(n,m,k);
while n>0 do
begin
fillchar(a,sizeof(a),0);
fillchar(c,sizeof(c),0);
for i:=1 to m do
begin
readln(p,q);
if p<>q ...
Search found 4 matches
- Sun Oct 19, 2003 11:47 am
- Forum: Volume 105 (10500-10599)
- Topic: 10543 - Traveling Politician
- Replies: 25
- Views: 9438
- Sun Oct 19, 2003 11:37 am
- Forum: Volume 4 (400-499)
- Topic: 498 - Polly the Polynomial
- Replies: 73
- Views: 21970
- Sat Oct 18, 2003 10:14 am
- Forum: Volume 5 (500-599)
- Topic: 523 - Minimum Transport Cost
- Replies: 44
- Views: 16840
- Sat Oct 18, 2003 4:24 am
- Forum: Volume 5 (500-599)
- Topic: 523 - Minimum Transport Cost
- Replies: 44
- Views: 16840
523 Time Limit Exceeded
I use 'Floyd' algorithm(O(n^3)) for this problem, but i got a TLE.
I wonder if there is any better algorithm for it?
and also, they don't declare how big is the data size(n, I mean).
I wonder if there is any better algorithm for it?
