Submission #3453791


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=1 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 0
Code Size 882 Byte
Status WA
Exec Time 3 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 subtask All
Score / Max Score 0 / 0 0 / 300 0 / 300
Status
AC × 1
WA × 3
AC × 5
WA × 15
AC × 14
WA × 44
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 WA 3 ms 256 KB
10.txt AC 0 ms 128 KB
11.txt WA 2 ms 128 KB
12.txt AC 0 ms 128 KB
13.txt WA 2 ms 128 KB
14.txt WA 2 ms 128 KB
15.txt WA 2 ms 128 KB
16.txt WA 2 ms 128 KB
17.txt AC 0 ms 128 KB
18.txt WA 2 ms 128 KB
19.txt WA 2 ms 128 KB
2.txt AC 0 ms 128 KB
20.txt WA 2 ms 128 KB
21.txt AC 0 ms 128 KB
22.txt AC 0 ms 128 KB
23.txt WA 2 ms 128 KB
24.txt WA 2 ms 128 KB
25.txt WA 2 ms 128 KB
26.txt WA 2 ms 128 KB
27.txt AC 0 ms 128 KB
28.txt WA 2 ms 128 KB
29.txt WA 2 ms 128 KB
3.txt WA 2 ms 128 KB
30.txt WA 2 ms 128 KB
31.txt WA 2 ms 128 KB
32.txt WA 2 ms 128 KB
33.txt WA 2 ms 128 KB
34.txt WA 2 ms 128 KB
4.txt WA 2 ms 128 KB
5.txt WA 2 ms 128 KB
6.txt WA 2 ms 128 KB
7.txt AC 0 ms 128 KB
8.txt WA 2 ms 128 KB
9.txt WA 2 ms 128 KB
sample1.txt WA 0 ms 128 KB
sample2.txt AC 0 ms 128 KB
sample3.txt WA 0 ms 128 KB
sample4.txt WA 0 ms 128 KB
sub1.txt WA 0 ms 128 KB
sub10.txt AC 0 ms 128 KB
sub11.txt WA 1 ms 128 KB
sub12.txt AC 0 ms 128 KB
sub13.txt WA 1 ms 128 KB
sub14.txt WA 1 ms 128 KB
sub15.txt WA 1 ms 128 KB
sub16.txt WA 1 ms 128 KB
sub2.txt AC 0 ms 128 KB
sub3.txt WA 1 ms 128 KB
sub4.txt WA 1 ms 128 KB
sub5.txt WA 1 ms 128 KB
sub6.txt WA 1 ms 128 KB
sub7.txt AC 0 ms 128 KB
sub8.txt WA 1 ms 128 KB
sub9.txt WA 1 ms 128 KB