## 260 - misunderstood

Moderator: Board moderators

### 260 - misunderstood

how does white wins in the first game?

there is more than one path from row 1 to row 4 for black:
(1, 2) -> (2, 3) -> (3, 2) -> (4, 1)
or
(1, 4) -> (2, 3) -> (3, 2) -> (4, 1)

same for the 2nd game. it seems to me that everyone is winning the game can anyone help me to understand this problem?

Donotalo
Learning poster

Posts: 56
Joined: Sat Aug 20, 2005 11:05 am

(2, 3) and (3, 2) are not adjacent. Read the problem statement carefully, every cell has only up to 6 neighbours.
mf
Guru

Posts: 1244
Joined: Mon Feb 28, 2005 4:51 am
Location: Zürich, Switzerland

Hi all
I've got accepted in this problem
but there is something that make me confius...
first I got TLE because:

Code: Select all
`char line[201],arr[200][201];int I,i;while(1){     gets(line);     sscanf(line,"%d",&I);     if(!I) break;     for(i=0;i<I;i++)           gets(arr[i]);}`

and got accepted by changing:

Code: Select all
`char temp,arr[200][201];int I,i;while(1){     scanf("%d",&I);     scanf("%c",&temp);     if(!I) break;     for(i=0;i<I;i++)           gets(arr[i]);}`

what's the differences?

algoJo
New poster

Posts: 37
Joined: Sun Dec 17, 2006 9:02 am

### Re: 260 - misunderstood

After taking integer input,when you press 'enter', then this newline is counted as first row of grid. So after taking integer, you can use getchar() to ignore newline.
BUET
New poster

Posts: 19
Joined: Sun Jun 13, 2010 8:38 am

### Re: 260 -why WAAAAAAAAAA

cut.....
ACC.......
we r surrounded by happiness
need eyes to feel it!