ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1334. Checkers

Need Your Help with test #22
Posted by Nikita 22 Apr 2009 20:22


Edited by author 23.04.2009 05:04
Re: Need Your Help with test #22
Posted by hoan 23 Dec 2010 21:56
try this test:
input:
a1
h8
a3
h6
a5
h4
a7
h2
b2
g7
b4
g5
b6
g3
b8
g1
c1
f8
c3
f6
c5
f4
c7
f2
d2
e7
d4
e5
d6
e3
d8
e1
output:
Draw

first my code write 31.
Re: Need Your Help with test #22
Posted by kostan3 2 Oct 2013 23:31
program ural1334;
const
  dx:array[1..8]of shortint=(-1,-1,-1,0,1,1,1,0);
  dy:array[1..8]of shortint=(-1,0,1,1,1,0,-1,-1);
var
  a:array[0..9,0..9]of byte;
  i,x,y,d:byte;
  c:char;
begin
  fillchar(a,sizeof(a),2);
  for i:=1 to 32 do begin
    readln(c,y);
    x:=ord(c)-96;
    for d:=1 to 8 do
      if a[x+dx[d],y+dy[d]]+i and 1=1 then begin
        writeln(i);
        halt;
      end;
    a[x,y]:=i and 1;
  end;
  writeln('Draw');
end.