Test | Status | Code Input and Output |
---|---|---|
1 | Pass |
%%
%http://contest.usc.edu/index.php/Fall12/Home?action=download&upname=water.in.txt
tic
urlwrite('http://contest.usc.edu/index.php/Fall12/Home?action=download&upname=water.in.txt','water_in.txt');
toc
Elapsed time is 0.782733 seconds.
|
2 | Pass |
%%
fid=fopen('water_in.txt','r');
w_area_expect=[8 16;100 100;0 1;1 1;5 9;186 675;23 110; 480 2500;102 2500;61 400; ...
73 930;160 441; 678 800; 55 361; 53 195;216 1296;199 1110;81 576;232 552;12 30;9 25;15 25;25 143; ...
66 120;2500 2500;270 1680;264 900;292 1365;748 2401;244 609;315 1296;214 1188];
qty=fscanf(fid,'%i',1);
for q=1:qty
n = fscanf(fid,'%i %i %i\n',3)'; % rows / cols / min rect
s=n(3);
n=n(1:2);
strv=fgetl(fid);
iswater=strv;
A=zeros(n); % Format is rows, columns
for i=1:n(1)
strv = fgetl(fid);
A(i,:) = strv;
end
A=char(A);
[w,w_area]=Water_analysis(A,iswater,s);
assert(isequal([w w_area],w_area_expect(q,:)));
end
fprintf('Processing Complete\n\n')
fclose(fid);
toc
Processing Complete
Elapsed time is 6.512045 seconds.
|
5703 Solvers
17123 Solvers
Matrix with different incremental runs
106 Solvers
Generate N equally spaced intervals between -L and L
563 Solvers
81 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!