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

一直WA求大神指正

Posted by 757464484 at 2013-03-20 12:31:25 on Problem 2446
```#include<cstdio>
#include<cstring>
using namespace std;
{
int value;
int next;
};
int kk;
void create(int n)
{
for(int i=1;i<=n;i++)
kk=1;
}
{
ljb[kk].value=val;
}
bool visit[1050];
int map[40][40];
int m,n,k,tm,tn;
int find(int num)
{
{
if(!visit[ljb[i].value])
{
visit[ljb[i].value]=true;
{
return 1;
}
}
}
return 0;
}
int main()
{
int x,y;
while(scanf("%d%d%d",&m,&n,&k)!=EOF)
{
create(m*n);
memset(map,-1,sizeof(map));
tm=tn=0;
for(int i=1;i<=k;i++)
{
scanf("%d%d",&x,&y);
map[y][x]=0;
}
for(int r=1;r<=m;r++)
for(int c=1;c<=n;c++)
{
if((r+c)%2&&map[r][c]!=0)
map[r][c]=++tm;
else if((r+c)%2==0&&map[r][c]!=0)
map[r][c]=++tn;
}
for(int r=1;r<=m;r++)
for(int c=1;c<=n;c++)
{
if((r+c)%2==0&&map[r][c]!=0)
{
if(r+1<=m&&map[r+1][c]!=0)
if(c+1<=n&&map[r][c+2]!=0)
if(r-1>0&&map[r-1][c]!=0)
if(c-1>0&&map[r][c-1]!=0)
}
}
int sum=0;
for(int i=1;i<=tn;i++)
{
memset(visit,false,sizeof(visit));
if(find(i))
sum++;
}
if(sum*2==m*n-k)
printf("YES\n");
else
printf("NO\n");
}
}
```

Followed by:

User ID:
Title:

Content: