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 1510. Order

New Test 38
Posted by George_Aloyan[PTS Obninsk] 23 Nov 2011 18:43
What is there in this test?
This solution now gets WA38

var
 ar : array[1..10,0..9] of longint;
 n,i,a1,a,j,max : longint;
begin
readln(n);
for j := 1 to n do
 begin
  readln(a);
  i := 1;
  while a <> 0 do
   begin
    a1 := a mod 10;
    a := a div 10;
    inc(ar[i,a1]);
    inc(i);
   end;
 end;
n := 0;
for i := 10 downto 1 do
 begin
  max := 0;
  for j := 1 to 9 do
   if ar[i,j] > ar[i,max] then
    max := j;
  n := n*10 + max;
 end;
writeln(n);
end.
Re: New Test 38
Posted by George_Aloyan[PTS Obninsk] 24 Nov 2011 22:56
Try tests with leading 0
Re: New Test 38
Posted by George_Aloyan[PTS Obninsk] 24 Nov 2011 22:57
Try tests with leading 0