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 1313. Some Words about Sport

Why WA #1?
Posted by egor-belikov 1 Oct 2010 04:56
On my computer it is working correctly.

var a : array [1..100, 1..100] of integer;
result : array [1..20000] of integer;
i, j, ah, b, n, count : integer;
begin
  readln (n);
  for i := 1 to n do begin
    for j := 1 to n do
      read (a[i, j]);
    readln;
  end;
  for i := 1 to (n*2-1) do begin
    if (i < n) then begin
      ah := i;
      b := 1;
    end else begin
      ah := n;
      b :=  i - n + 1;
    end;
    while (ah>=1) do begin
      inc (count);
      result [count] := a [ah, b];
      dec (ah);
      inc (b);
    end;
  end;
  for i := 1 to count do
    if (result [i] <> 0) then
      write (result [i]);
  writeln;
end.
Re: Why WA #1?
Posted by Artem Fast 15 Dec 2011 16:24
I think u should write " " after each number