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 1164. Fillword

Why I got WA!!!HelpHelpHelp!This is my grogram.
Posted by Superthinker 24 Jul 2003 05:56
Why I got WA!!!HelpHelpHelp!This is my grogram:

var
  Save : array ['A' .. 'Z'] of longint;
  n, m, p, i, j : longint;
  c : char;
begin
  fillchar (Save, sizeof (Save), 0);
  readln (n, m, p);
  for i := 1 to n do
    begin
      for j := 1 to m do
        begin
          read (c);
          Save [c] := Save [c] + 1;
        end;
      readln;
    end;
  for i := 1 to p do
    begin
      for j := 1 to m do
        begin
          read (c);
          Save [c] := Save [c] - 1;
        end;
      readln;
    end;
  for c := 'A' to 'Z' do
    for i := 1 to Save [c] do
      write (c);
end.
Don't waste your time.I've Got AC.This is my right program.
Posted by Superthinker 24 Jul 2003 06:08
var
  Save : array ['A' .. 'Z'] of longint;
  n, m, p, i, j : longint;
  c : char;
begin
  fillchar (Save, sizeof (Save), 0);
  readln (n, m, p);
  for i := 1 to n do
    begin
      for j := 1 to m do
        begin
          read (c);
          Save [c] := Save [c] + 1;
        end;
      readln;
    end;
  for i := 1 to p do
    begin
      read (c);
      while not (c in ['A' .. 'Z']) do
        read (c);
      while c in ['A' .. 'Z'] do
        begin
          Save [c] := Save [c] - 1;
          read (c);
        end;
    end;
  for c := 'A' to 'Z' do
    for i := 1 to Save [c] do
      write (c);
end.