260 - misunderstood

All about problems in Volume II. If there is a thread about your problem, please use it. If not, create one with its number in the subject.

Moderator: Board moderators

260 - misunderstood

Postby Donotalo » Sat Sep 16, 2006 9:09 pm

how does white wins in the first game?

Image

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 :oops: can anyone help me to understand this problem?
Image
User avatar
Donotalo
Learning poster
 
Posts: 56
Joined: Sat Aug 20, 2005 11:05 am
Location: Bangladesh

Postby mf » Sat Sep 16, 2006 9:42 pm

(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

Postby algoJo » Wed Jan 31, 2007 3:07 pm

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?
User avatar
algoJo
New poster
 
Posts: 37
Joined: Sun Dec 17, 2006 9:02 am

Re: 260 - misunderstood

Postby BUET » Tue Nov 30, 2010 7:24 am

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: 22
Joined: Sun Jun 13, 2010 8:38 am

Re: 260 -why WAAAAAAAAAA

Postby mahade hasan » Wed Aug 08, 2012 10:32 am

cut.....
ACC.......
we r surrounded by happiness
need eyes to feel it!
User avatar
mahade hasan
Learning poster
 
Posts: 86
Joined: Thu Dec 15, 2011 3:08 pm
Location: University of Rajshahi,Bangladesh


Return to Volume II

Who is online

Users browsing this forum: No registered users and 3 guests