-͒03

22 2003

7-8 ( C)

 

1.

 

N (2 < N < 102) , N . , . -. , . , ( ) , .. 1 1 2, 2 2 3, ..., N 1 N 1 N, N N 1.

, 1 2 1, . , , , .

BULB.EXE, , .

, . N. N , : 1, 0, .

. , . , 1.

 

 

Text Box:  
.1

 

1 .1

 

:

6

0 0 1 0 1 0

 

:

3


 

Text Box:  

.2

 

2 .2

 

:

3

1 0 1

 

:

-1

 

: 1 1, 4, 5 2, 3, 6.


-͒03

22 2003

7-8 ( C)

 

C2.

 

. :

 

 

:

1.

x+

(x,y) (x+1,y)

2.

x-

(x,y) (x-1,y)

3.

y+

(x,y) (x,y+1)

4.

y-

(x,y) (x,y-1)

 

, (0,0), x+ x+ y+ x+ y- y- (3,-1).

MOVE.EXE, (x0,y0) , (x1,y1), , .

. 堠 x0 y0 , .

: - 10 000, , 堠 x/y +/- .

. x1 y1, .

 

:

 

0 0 100 200

x+ x+ y+ x+ y- y- y+xx+y-

 

3 1 100 200

 

 

 

 


-͒03

22 2003

7-8 ( C)

 

C3.

 

() () , * =. * , , = , . . ISLANDS.EXE, . , *. , .

0 < N <= 1000, , N N * =. . , .. *. .

.

 

:

 

5 10

===== ====***===

=*=*= *==**==*=*

**=== ===***=*==

==**= *=***=***=

===*= **=====*==

***=======

*====*==**

*==******* **********

3                                                                                                                                                                               **********

5