Submission #19985


Source Code Expand

Copy
{$R-,S-,Q-,I-,O+}
var n,i,j:longint;
	s:array[0..101] of string;
	t:string;

procedure quicksort(l,r:longint);
var v,t:string;i,j:longint;
begin
	if l<r then begin
		v:=s[r];i:=l-1;j:=r;
		repeat
			repeat inc(i) until v<=s[i];
			repeat dec(j) until s[j]<=v;
			t:=s[i];s[i]:=s[j];s[j]:=t;
		until j<=i;
		s[j]:=s[i];s[i]:=s[r];s[r]:=t;
		quicksort(l,i-1);
		quicksort(i+1,r);
	end;
end;	

begin
	readln(n);
	for i:=1 to n do begin
		readln(t);
		for j:=length(t) downto 1 do s[i]:=s[i]+t[j];
	end;
	quicksort(1,n);
	for i:=1 to n do begin
		for j:=length(s[i]) downto 1 do write(s[i][j]);
		writeln;
	end;
end.

Submission Info

Submission Time
Task B - さかさま辞書
User urutom
Language Pascal (fpc 2.4.4)
Score 100
Code Size 644 Byte
Status AC
Exec Time 21 ms
Memory 788 KB

Compile Error

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

Judge Result

Set Name all
Score / Max Score 100 / 100
Status
AC × 28
Set Name Test Cases
all 00_sample_01.txt, 00_sample_02.txt, 01_rand_01.txt, 01_rand_02.txt, 01_rand_03.txt, 01_rand_04.txt, 01_rand_05.txt, 01_rand_06.txt, 01_rand_07.txt, 01_rand_08.txt, 01_rand_09.txt, 01_rand_10.txt, 02_long_01.txt, 02_long_02.txt, 02_long_03.txt, 03_short_01.txt, 03_short_02.txt, 03_short_03.txt, 04_max_01.txt, 04_max_02.txt, 04_max_03.txt, 04_max_04.txt, 04_max_05.txt, 05_samestring_01.txt, 05_samestring_02.txt, 05_samestring_03.txt, 05_samestring_04.txt, 05_samestring_05.txt
Case Name Status Exec Time Memory
00_sample_01.txt AC 20 ms 668 KB
00_sample_02.txt AC 20 ms 684 KB
01_rand_01.txt AC 19 ms 664 KB
01_rand_02.txt AC 21 ms 672 KB
01_rand_03.txt AC 19 ms 656 KB
01_rand_04.txt AC 19 ms 664 KB
01_rand_05.txt AC 20 ms 660 KB
01_rand_06.txt AC 19 ms 788 KB
01_rand_07.txt AC 19 ms 668 KB
01_rand_08.txt AC 19 ms 668 KB
01_rand_09.txt AC 19 ms 660 KB
01_rand_10.txt AC 19 ms 660 KB
02_long_01.txt AC 19 ms 668 KB
02_long_02.txt AC 19 ms 652 KB
02_long_03.txt AC 20 ms 664 KB
03_short_01.txt AC 19 ms 704 KB
03_short_02.txt AC 19 ms 688 KB
03_short_03.txt AC 19 ms 704 KB
04_max_01.txt AC 20 ms 656 KB
04_max_02.txt AC 20 ms 668 KB
04_max_03.txt AC 20 ms 668 KB
04_max_04.txt AC 20 ms 668 KB
04_max_05.txt AC 21 ms 692 KB
05_samestring_01.txt AC 20 ms 768 KB
05_samestring_02.txt AC 20 ms 788 KB
05_samestring_03.txt AC 20 ms 668 KB
05_samestring_04.txt AC 20 ms 672 KB
05_samestring_05.txt AC 20 ms 668 KB