Submission #2240061

Source Code Expand

Copy
[n,y] = scanf('%d %d','C');
y = y / 1000;

%     j + k = n - i
% 5 * j + k = y - 10 * i
% 4 * j = y - 10 * i - (n - i) 

for i = 0:n
	right_val = y - 10 * i - (n-i);
	if mod(right_val,4) ~=0 
		continue;
	end
	j = right_val / 4;
	k = n - i - j;
	if j >= 0 && k >= 0
		printf('%d %d %d\n',i,j,k);
		exit;
	end
end

printf('-1 -1 -1\n');

Submission Info

Submission Time
Task ABC085C - Otoshidama
User Hec
Language Octave (4.0.2)
Score 300
Code Size 357 Byte
Status
Exec Time 167 ms
Memory 11464 KB

Test Cases

Set Name Score / Max Score Test Cases
Sample 0 / 0 a01, a02, a03, a04
All 300 / 300 a01, a02, a03, a04, b05, b06, b07, b08, b09, b10, b11, b12, b13, b14, b15, b16, b17, b18, b19, b20, b21, b22, b23, b24
Case Name Status Exec Time Memory
a01 159 ms 10944 KB
a02 141 ms 9416 KB
a03 140 ms 9420 KB
a04 164 ms 9420 KB
b05 142 ms 9420 KB
b06 140 ms 9416 KB
b07 141 ms 9420 KB
b08 139 ms 9412 KB
b09 167 ms 11464 KB
b10 164 ms 9540 KB
b11 164 ms 9416 KB
b12 139 ms 9420 KB
b13 139 ms 9416 KB
b14 139 ms 9416 KB
b15 165 ms 9416 KB
b16 163 ms 9416 KB
b17 164 ms 9416 KB
b18 140 ms 9540 KB
b19 141 ms 9420 KB
b20 139 ms 9416 KB
b21 164 ms 9420 KB
b22 164 ms 9412 KB
b23 164 ms 9416 KB
b24 165 ms 9420 KB