Submission #1195316
Source Code Expand
var n,i,x:longint; s:int64; a:array[0..300003] of longint; fi,fo:text; procedure start; begin assign(fi,''); reset(fi); assign(fo,''); rewrite(fo); readln(fi,n); n:= 3*n; for i:= 1 to n do read(fi,a[i]); end; procedure sort(l,r:longint); var i,j,mid,tmp:longint; begin i:= l; j:= r; mid:= a[(l+r)div 2]; repeat while a[i]<mid do inc(i); while a[j]>mid do dec(j); if i<=j then begin tmp:= a[i]; a[i]:= a[j]; a[j]:= tmp; inc(i); dec(j); end; until i>j; if l<j then sort(l,j); if i<r then sort(i,r); end; procedure main; begin s:= 0; x:= n+1; for i:= 1 to n div 3 do s:= s+a[x-2*i]; end; begin start; sort(1,n); main; writeln(fo,s); close(fi); close(fo); end.
Submission Info
Submission Time | |
---|---|
Task | A - AtCoder Group Contest |
User | npnkhoi |
Language | Pascal (FPC 2.6.2) |
Score | 300 |
Code Size | 846 Byte |
Status | AC |
Exec Time | 61 ms |
Memory | 1280 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 | 300 / 300 | ||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | 00_example_01.txt, 00_example_02.txt |
All | 00_example_01.txt, 00_example_02.txt, 01.txt, 02.txt, 03.txt, 04.txt, 05.txt, 06.txt, 07.txt, 08.txt, 09.txt, 10.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
00_example_01.txt | AC | 0 ms | 128 KB |
00_example_02.txt | AC | 0 ms | 128 KB |
01.txt | AC | 0 ms | 128 KB |
02.txt | AC | 0 ms | 128 KB |
03.txt | AC | 0 ms | 128 KB |
04.txt | AC | 0 ms | 128 KB |
05.txt | AC | 4 ms | 128 KB |
06.txt | AC | 58 ms | 1280 KB |
07.txt | AC | 29 ms | 1280 KB |
08.txt | AC | 61 ms | 1280 KB |
09.txt | AC | 61 ms | 1280 KB |
10.txt | AC | 61 ms | 1280 KB |