Submission #2239970

Source Code Expand

Copy
n = scanf('%d','C');

a = zeros(n,1);

for i = 1:n
	a(i) = scanf('%d','C'); 
end

a = sort(a,'descend');

ans = 0;

for i = 1:n
	if mod(i,2) == 1
		ans = ans + a(i);
	else
		ans = ans - a(i);
	end
end

printf('%d\n',ans);

Submission Info

Submission Time
Task ABC088B - Card Game for Two
User Hec
Language Octave (4.0.2)
Score 200
Code Size 243 Byte
Status
Exec Time 143 ms
Memory 9536 KB

Test Cases

Set Name Score / Max Score Test Cases
Sample 0 / 0 sample_1.txt, sample_2.txt, sample_3.txt
All 200 / 200 in1.txt, in2.txt, in3.txt, in4.txt, in5.txt, in6.txt, in7.txt, in8.txt, in9.txt, sample_1.txt, sample_2.txt, sample_3.txt
Case Name Status Exec Time Memory
in1.txt 139 ms 9420 KB
in2.txt 140 ms 9416 KB
in3.txt 139 ms 9420 KB
in4.txt 140 ms 9536 KB
in5.txt 143 ms 9416 KB
in6.txt 143 ms 9416 KB
in7.txt 143 ms 9416 KB
in8.txt 143 ms 9416 KB
in9.txt 142 ms 9416 KB
sample_1.txt 139 ms 9420 KB
sample_2.txt 140 ms 9420 KB
sample_3.txt 140 ms 9416 KB