Submission #9164268


Source Code Expand

Copy
var
N,X,Y,Z,i,p:Longint;
S:String;
begin
readln(N,X,X);
readln(S);
i:=length(S);
Z:=0;
p:=1;
while(1<=i)and(S[i]<>' ')do begin
inc(Z,(ord(S[i])-48)*p);
p:=p*10;
dec(i);
end;
dec(i);
Y:=0;
p:=1;
if N=1 then Y:=X
else begin
while(1<=i)and(S[i]<>' ')do begin
inc(Y,(ord(S[i])-48)*p);
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
var
	N,X,Y,Z,i,p:Longint;
	S:String;
begin
	readln(N,X,X);
	readln(S);
	i:=length(S);
	Z:=0;
	p:=1;
	while(1<=i)and(S[i]<>' ')do begin
		inc(Z,(ord(S[i])-48)*p);
		p:=p*10;
		dec(i);
	end;
	dec(i);
	Y:=0;
	p:=1;
	if N=1 then Y:=X
	else begin
		while(1<=i)and(S[i]<>' ')do begin
			inc(Y,(ord(S[i])-48)*p);
			p:=p*10;
			dec(i);
		end;
	end;
	dec(X,Z);
	dec(Y,Z);
	if X<0 then X:=-X;
	if Y<0 then Y:=-Y;
	if X<Y then X:=Y;
	writeln(X);
end.

Submission Info

Submission Time
Task D - ABS
User kotatsugame
Language Pascal (FPC 2.6.2)
Score 500
Code Size 473 Byte
Status AC
Exec Time 0 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 500 / 500
Status
AC × 4
AC × 28
Set Name Test Cases
Sample example_0, example_1, example_2, example_3
All example_0, example_1, example_2, example_3, one_0, one_1, one_2, one_3, one_4, one_5, one_6, one_7, rand_0, rand_1, rand_10, rand_11, rand_12, rand_13, rand_14, rand_15, rand_2, rand_3, rand_4, rand_5, rand_6, rand_7, rand_8, rand_9
Case Name Status Exec Time Memory
example_0 AC 0 ms 128 KB
example_1 AC 0 ms 128 KB
example_2 AC 0 ms 128 KB
example_3 AC 0 ms 128 KB
one_0 AC 0 ms 128 KB
one_1 AC 0 ms 128 KB
one_2 AC 0 ms 128 KB
one_3 AC 0 ms 128 KB
one_4 AC 0 ms 128 KB
one_5 AC 0 ms 128 KB
one_6 AC 0 ms 128 KB
one_7 AC 0 ms 128 KB
rand_0 AC 0 ms 128 KB
rand_1 AC 0 ms 128 KB
rand_10 AC 0 ms 128 KB
rand_11 AC 0 ms 128 KB
rand_12 AC 0 ms 128 KB
rand_13 AC 0 ms 128 KB
rand_14 AC 0 ms 128 KB
rand_15 AC 0 ms 128 KB
rand_2 AC 0 ms 128 KB
rand_3 AC 0 ms 128 KB
rand_4 AC 0 ms 128 KB
rand_5 AC 0 ms 128 KB
rand_6 AC 0 ms 128 KB
rand_7 AC 0 ms 128 KB
rand_8 AC 0 ms 128 KB
rand_9 AC 0 ms 128 KB


2025-04-15 (Tue)
02:48:06 +00:00