hdu 1011那位大牛能帮我看看代码 为什么总是wa啊?感激不尽啊!#include #include #include #include using namespace std;long n,m;long a[101],b[101],l[101],r[101],f[101][101];long work(long,long);long work(long x,long y){long i,j;if ((x
来源:学生作业帮助网 编辑:六六作业网 时间:2024/11/07 18:47:10
hdu 1011那位大牛能帮我看看代码 为什么总是wa啊?感激不尽啊!#include #include #include #include using namespace std;long n,m;long a[101],b[101],l[101],r[101],f[101][101];long work(long,long);long work(long x,long y){long i,j;if ((x
hdu 1011那位大牛能帮我看看代码 为什么总是wa啊?感激不尽啊!
#include
#include
#include
#include
using namespace std;
long n,m;
long a[101],b[101],l[101],r[101],f[101][101];
long work(long,long);
long work(long x,long y)
{
long i,j;
if ((x==0)||(y==0)) return (0);
if ((l[x]==0)&&(r[x]==0))
{
if (20*y
hdu 1011那位大牛能帮我看看代码 为什么总是wa啊?感激不尽啊!#include #include #include #include using namespace std;long n,m;long a[101],b[101],l[101],r[101],f[101][101];long work(long,long);long work(long x,long y){long i,j;if ((x
#include
#include
#include
#include
using namespace std;
long n,m;
long a[101],b[101],l[101],r[101],f[101][101];
long work(long,long);
long work(long x,long y)
{
long i,j;
if ((x==0)||(y==0)) return (0);
if ((l[x]==0)&&(r[x]==0))
{
if (20*y>n>>m;//scanf("%d%d",&n,&m);你没有包括头文件cstdio,那么别用scanf()
if ((n==-1)&&(m==-1)) break;
memset(l,0,sizeof(l));
memset(r,0,sizeof(r));
memset(f,0,sizeof(f));
for (i=1;i>a[i]>>b[i];//scanf("%d%d",&a[i],&b[i]);同上
for (i=1;i>j>>k;//scanf("%d%d",&j,&k);同上
if (k==1)
{
p=k; k=j; j=p;
}
if (l[j]==0)
l[j]=k;
else
{
p=l[j];
while (r[p]!=0) p=r[p];
r[p]=k;
}
}
p=work(1,m);
cout