Submission #3717266


Source Code Expand

var
  even,odd,n,i,j:longint;
  a:array[0..1000] of longint;
begin
  readln(n);
  for i:=1 to n do read(a[i]);
  for i:=1 to n-1 do
   for j:=i+1 to n do
    if a[i]<a[j] then begin a[0]:=a[i];a[i]:=a[j];a[j]:=a[0]; end;
  for i:=1 to n do
   if i mod 2=0 then even:=even+a[i]
                else odd:=odd+a[i];
  if even>odd then writeln(even)
              else writeln(odd);
end.

//555

Submission Info

Submission Time
Task A - カードと兄妹
User luogu_bot5
Language Pascal (FPC 2.6.2)
Score 100
Code Size 406 Byte
Status AC
Exec Time 3 ms
Memory 128 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 × 2
AC × 13
Set Name Test Cases
Sample sample-01.txt, sample-02.txt
All 01-01.txt, 01-02.txt, 01-03.txt, 01-04.txt, 01-05.txt, 01-06.txt, 01-07.txt, 01-08.txt, 01-09.txt, 01-10.txt, 01-11.txt, sample-01.txt, sample-02.txt
Case Name Status Exec Time Memory
01-01.txt AC 0 ms 128 KB
01-02.txt AC 0 ms 128 KB
01-03.txt AC 0 ms 128 KB
01-04.txt AC 0 ms 128 KB
01-05.txt AC 0 ms 128 KB
01-06.txt AC 0 ms 128 KB
01-07.txt AC 3 ms 128 KB
01-08.txt AC 3 ms 128 KB
01-09.txt AC 1 ms 128 KB
01-10.txt AC 1 ms 128 KB
01-11.txt AC 1 ms 128 KB
sample-01.txt AC 0 ms 128 KB
sample-02.txt AC 0 ms 128 KB