Submission #1709129


Source Code Expand

program Project1;

{$APPTYPE CONSOLE}

uses
  SysUtils,StrUtils;

function MatchText0000(const AText: string; const AValues: array of string): Boolean;
var
  i:Integer;
begin
  result:=false;
  for i := 0 to Length(AValues) - 1 do begin
    if AText=AValues[i] then
      result:=True;
  end;
end;

var
  n,i,j,a1:Integer;
  kouhosha:string;
  tokuhyou:array of string;
  hyousuu:array of Integer;
begin
  try
    { TODO -oUser -cConsole Main : ここにコードを記述してください }
    Readln(n);
    SetLength(tokuhyou,n);
    SetLength(hyousuu,n);
    for i := 0 to n - 1 do begin
      Readln(kouhosha);
      if not MatchText0000(kouhosha, tokuhyou) then //いなければ追加
        tokuhyou[i]:=kouhosha
      else //いたら
      for j := 0 to i - 1 do begin //検索してカウント
        if tokuhyou[j]=kouhosha then
          Inc(hyousuu[j]);
      end;
    end;

    a1:=0;
    for i := 0 to n-1 do begin //多かった人は
      if hyousuu[i]>hyousuu[a1] then
        a1:=i;
    end;
    Writeln(tokuhyou[a1]);
    Readln;
  except
    on E: Exception do
      Writeln(E.ClassName, ': ', E.Message);
  end;
end.

Submission Info

Submission Time
Task B - 投票
User nmoxya
Language Pascal (FPC 2.6.2)
Score 100
Code Size 1196 Byte
Status AC
Exec Time 1 ms
Memory 256 KB

Compile Error

/usr/bin/ld.bfd: warning: ./link.res contains output sections; did you forget -T?

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 100 / 100
Status
AC × 3
AC × 18
Set Name Test Cases
Sample sample_01.txt, sample_02.txt, sample_03.txt
All sample_01.txt, sample_02.txt, sample_03.txt, case_01.txt, case_02.txt, case_03.txt, case_04.txt, case_05.txt, case_06.txt, case_07.txt, case_08.txt, case_09.txt, case_10.txt, case_11.txt, case_12.txt, case_13.txt, case_14.txt, case_15.txt
Case Name Status Exec Time Memory
case_01.txt AC 1 ms 256 KB
case_02.txt AC 1 ms 256 KB
case_03.txt AC 1 ms 256 KB
case_04.txt AC 1 ms 256 KB
case_05.txt AC 1 ms 256 KB
case_06.txt AC 1 ms 256 KB
case_07.txt AC 1 ms 256 KB
case_08.txt AC 1 ms 256 KB
case_09.txt AC 1 ms 256 KB
case_10.txt AC 0 ms 256 KB
case_11.txt AC 1 ms 256 KB
case_12.txt AC 1 ms 256 KB
case_13.txt AC 1 ms 256 KB
case_14.txt AC 1 ms 256 KB
case_15.txt AC 1 ms 256 KB
sample_01.txt AC 0 ms 256 KB
sample_02.txt AC 1 ms 256 KB
sample_03.txt AC 1 ms 256 KB