Submission #3453798


Source Code Expand

var
	n,i,j,c,a,b:Longint;
	x,y,d:array[1..100000]of Longint;
begin
	read(n);
	for i:=1 to n do begin
		read(x[i],y[i]);
		if (abs(x[i])+abs(y[i]))mod 2<>(abs(x[1])+abs(y[1]))mod 2 then begin
			writeln(-1);
			exit;
		end;
	end;
	a:=1073741824;
	while a>0 do begin
		inc(c);
		d[c]:=a;
		a:=a div 2;
	end;
	if (abs(x[1])+abs(y[1]))mod 2=0 then begin
		inc(c);
		d[c]:=1;
	end;
	writeln(c);
	for i:=1 to c do write(d[i],' ');
	writeln;
	for i:=1 to n do begin
		a:=x[i];
		b:=y[i];
		for j:=1 to c do begin
			if abs(a)>abs(b) then begin
				if a>0 then begin
					dec(a,d[j]);
					write('R');
				end else begin
					inc(a,d[j]);
					write('L');
				end;
			end else begin
				if b>0 then begin
					dec(b,d[j]);
					write('U');
				end else begin
					inc(b,d[j]);
					write('D');
				end;
			end;
		end;
		writeln;
	end;
end.

Submission Info

Submission Time
Task D - Robot Arms
User kotatsugame
Language Pascal (FPC 2.6.2)
Score 600
Code Size 882 Byte
Status AC
Exec Time 2 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 subtask All
Score / Max Score 0 / 0 300 / 300 300 / 300
Status
AC × 4
AC × 20
AC × 58
Set Name Test Cases
Sample sample1.txt, sample2.txt, sample3.txt, sample4.txt
subtask sample1.txt, sample2.txt, sample3.txt, sample4.txt, sub1.txt, sub10.txt, sub11.txt, sub12.txt, sub13.txt, sub14.txt, sub15.txt, sub16.txt, sub2.txt, sub3.txt, sub4.txt, sub5.txt, sub6.txt, sub7.txt, sub8.txt, sub9.txt
All sample1.txt, sample2.txt, sample3.txt, sample4.txt, 1.txt, 10.txt, 11.txt, 12.txt, 13.txt, 14.txt, 15.txt, 16.txt, 17.txt, 18.txt, 19.txt, 2.txt, 20.txt, 21.txt, 22.txt, 23.txt, 24.txt, 25.txt, 26.txt, 27.txt, 28.txt, 29.txt, 3.txt, 30.txt, 31.txt, 32.txt, 33.txt, 34.txt, 4.txt, 5.txt, 6.txt, 7.txt, 8.txt, 9.txt, sample1.txt, sample2.txt, sample3.txt, sample4.txt, sub1.txt, sub10.txt, sub11.txt, sub12.txt, sub13.txt, sub14.txt, sub15.txt, sub16.txt, sub2.txt, sub3.txt, sub4.txt, sub5.txt, sub6.txt, sub7.txt, sub8.txt, sub9.txt
Case Name Status Exec Time Memory
1.txt AC 0 ms 128 KB
10.txt AC 0 ms 128 KB
11.txt AC 2 ms 128 KB
12.txt AC 0 ms 128 KB
13.txt AC 2 ms 128 KB
14.txt AC 2 ms 128 KB
15.txt AC 2 ms 128 KB
16.txt AC 2 ms 128 KB
17.txt AC 0 ms 128 KB
18.txt AC 2 ms 128 KB
19.txt AC 2 ms 128 KB
2.txt AC 0 ms 128 KB
20.txt AC 2 ms 128 KB
21.txt AC 0 ms 128 KB
22.txt AC 0 ms 128 KB
23.txt AC 2 ms 128 KB
24.txt AC 2 ms 128 KB
25.txt AC 2 ms 128 KB
26.txt AC 2 ms 128 KB
27.txt AC 0 ms 128 KB
28.txt AC 2 ms 128 KB
29.txt AC 2 ms 128 KB
3.txt AC 2 ms 128 KB
30.txt AC 2 ms 128 KB
31.txt AC 2 ms 128 KB
32.txt AC 2 ms 128 KB
33.txt AC 2 ms 128 KB
34.txt AC 2 ms 128 KB
4.txt AC 2 ms 128 KB
5.txt AC 2 ms 128 KB
6.txt AC 2 ms 128 KB
7.txt AC 0 ms 128 KB
8.txt AC 2 ms 128 KB
9.txt AC 2 ms 128 KB
sample1.txt AC 0 ms 128 KB
sample2.txt AC 0 ms 128 KB
sample3.txt AC 0 ms 128 KB
sample4.txt AC 0 ms 128 KB
sub1.txt AC 0 ms 128 KB
sub10.txt AC 0 ms 128 KB
sub11.txt AC 1 ms 128 KB
sub12.txt AC 0 ms 128 KB
sub13.txt AC 1 ms 128 KB
sub14.txt AC 1 ms 128 KB
sub15.txt AC 1 ms 128 KB
sub16.txt AC 1 ms 128 KB
sub2.txt AC 0 ms 128 KB
sub3.txt AC 1 ms 128 KB
sub4.txt AC 1 ms 128 KB
sub5.txt AC 1 ms 128 KB
sub6.txt AC 1 ms 128 KB
sub7.txt AC 0 ms 128 KB
sub8.txt AC 1 ms 128 KB
sub9.txt AC 1 ms 128 KB