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 1219. Symbolic Sequence

This works
Posted by Lee Junhui Alvin 18 Nov 2002 17:51
program symbol;
var i:longint;
    n:longint;
    tr:array[1..26] of 0..1000000;
    q:char;
begin
  for i:=1 to 26 do
    tr[i]:=0;
  for i:=1 to 1000000 do
    begin
      repeat
        q:=char(random(26)+97);
        n:=ord(q)-96;
        inc(tr[n]);
      until tr[n]<=40000;
      write(q);
    end;
end.
Re: This works
Posted by cmc_hope 11 May 2004 11:06
Terrible!
I don't think it's right,although it's very lucky.
Your pascal is too longer!Look at me!
Posted by lz _nothing 23 May 2004 14:41
var
  i:longint;
begin
  randomize;
  for i:=1 to 1000000do
    write(chr(random(26)+ord('a')));
  writeln;
  readln;
end.