| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
部分代码#include<cstdio>
#include<cstring>
using namespace std;
struct node
{
int x,y,next,t;
}a[21000];
int last[21000],len;
void ins(int x,int y,int t)
{
len++;
a[len].x=x;a[len].y=y;a[len].t=t;
a[len].next=last[x];last[x]=len;
}
int d[1100],tt[110];
int head,tail,list[1100];
bool v[1100];
int main()
{
int i,j,n,A,B,m,x,y,max=0;
tt[1]=1;
for (i=2;i<=10;i++) tt[i]=tt[i-1]*10;
scanf("%d",&n);
memset(last,0,sizeof(last));len=0;
memset(v,false,sizeof(v));
for (i=2;i<=n;i++)
{
for (j=1;j<i;j++)
{
char ss[110];
scanf("%s",ss+1);
if (ss[1]=='x')
{
ins(j,i,99999999);
ins(i,j,99999999);
}
else
{
int ans=0;
for (int ii=strlen(ss+1);ii>=1;ii--)
{
ans+=(ss[ii]-'0')*tt[ strlen(ss+1)-ii+1 ];
}
ins(j,i,ans);
ins(i,j,ans);
}
}
}
for (i=1;i<=1000;i++) d[i]=99999999;
head=1;tail=2;
list[1]=1;v[1]=true;d[1]=0;
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator