Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

Re:请大牛们帮忙看看到底哪里错了!!!!!!超级感谢!!!!!!!!

Posted by xiaoxiaoluo at 2011-01-31 00:25:44 on Problem 1682
In Reply To:请大牛们帮忙看看到底哪里错了!!!!!!超级感谢!!!!!!!! Posted by:LiuYanlin001 at 2010-10-24 20:38:30
> 总是说我编译不过:
> Main.pas(47,66) Error: Illegal qualifier
> Main.pas(53,61) Error: Illegal qualifier
> Main.pas(86,4) Fatal: There were 2 errors compiling module, stopping
> Fatal: Compilation aborted
> 代码如下(pascal):
> {
> f1[i,j]表示z岸前i个部落与x岸前j个部落之间相连且i,j相连时的最小费用。
> f1[i,j]:=min(f1[i-1,j-1],min(f1[i-1,j],f1[i,j-1]))+abs(z[i]-x[j]);
> 边界:f[0,0]=0
> 
> f2[i,j]表示x岸第i到n个部落与y岸前j个部落之间相连且i,j相连时的最小费用。
> f2[i,j]:=min(f2[i+1,j-1],min(f2[i+1,j],f2[i,j-1]))+abs(x[i]-y[j]);
> 边界:f[n+1,0]=0
> 
> f3[i,j]表示z岸第i到k个部落与y岸第j到m个部落之间相连且i,j相连时的最小费用。
> f3[i,j]:=min(f3[i+1,j+1],min(f3[i+1,j],f3[i,j+1]))+abs(z[i]-y[j]);
> 边界:f[k+1,m+1]=0
> 
> ans表示建桥的最小总费用。
> ans:=min(ans,min(f2[j,l]+f2[i,l]+f3[j,i]));
> }
> var	f1,f2,f3:array [0..101,0..101] of longint;
> 	x,y,z:array [1..100] of longint;
> 	t,n,m,k,ans:longint;
> procedure init;
> var	i:longint;
> begin
> 	readln(n,m,k);
> 	for i:=1 to n do
> 		read(x[i]);
> 	readln;
> 	for i:=1 to m do
> 		read(y[i]);
> 	readln;
> 	for i:=1 to k do
> 		read(z[i]);
> 	readln;
> 	readln;
> end;
> function min(a,b:longint):longint;
> begin
> 	if a>b then min:=b
> 	else min:=a;
> end;
> procedure dp;
> var	i,j,x:longint;
> begin
> 	fillchar(f1,sizeof(f1),30);
> 	f1[0,0]:=0;
> 	for i:=1 to k do
> 		for j:=1 to n do
> 			f1[i,j]:=min(f1[i-1,j-1],min(f1[i-1,j],f1[i,j-1]))+abs(z[i]-x[j]);
> 	
> 	fillchar(f2,sizeof(f2),30);
> 	f2[n+1,0]:=0;
> 	for i:=n downto 1 do
> 		for j:=1 to m do
> 			f2[i,j]:=min(f2[i+1,j-1],min(f2[i+1,j],f2[i,j-1]))+abs(x[i]-y[j]);
> 	
> 	fillchar(f3,sizeof(f3),30);
> 	f3[k+1,m+1]:=0;
> 	for i:=k downto 1 do
> 		for j:=m downto 1 do
> 			f3[i,j]:=min(f3[i+1,j+1],min(f3[i+1,j],f3[i,j+1]))+abs(z[i]-y[j]);
> 	
> 	for i:=0 to n do
> 		for j:=0 to k do
> 			for x:=0 to m do
> 				ans:=min(ans,min(f1[j,i]+f2[i,x]+f3[j,x],min(f1[j,i]+f2[i,x]+f3[j,x+1],min(f1[j,i]+f2[i,x]+f3[j+1,x],min(f1[j,i]+f2[i,x]+f3[j+1,x+1],min(f1[j,i]+f2[i+1,x]+f3[j,x],min(f1[j,i]+f2[i+1,x]+f3[j,x+1],min(f1[j,i]+f2[i+1,x]+f3[j+1,x],f1[i,j]+f2[i+1,x]+f3[j+1,x+1]))))))));
> 	
> 	writeln(ans);
> end;
> begin
> 	assign(input,'poj1683.in');
> 	assign(output,'poj1683.out');
> 	reset(input);
> 	rewrite(output);
> 	
> 	readln(t);
> 	while t>0 do
> 	begin
> 		init;
> 		
> 		dp;
> 		
> 		dec(t);
> 	end;
> 	
> 	close(input);
> 	close(output);
> end.

Followed by:

Post your reply here:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator