Cody

Solution 551082

Submitted on 31 Dec 2014 by goc3
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

Test Suite

Test Status Code Input and Output
1   Pass
%% % Armegeddon tic urlwrite('http://contest.usc.edu/index.php/Spring12/Home?action=download&upname=armageddon.in.txt','armageddon.in.txt') toc

ans = /users/msssytem8/armageddon.in.txt Elapsed time is 0.213849 seconds.

2   Pass
%% fid=fopen('armageddon.in.txt','r'); t_expect=[0.00 -1 20.55 -1 -1 28.38 -1 11.03 2.62 4.22 13.15 9.94 61.33 13.56 -1]; qty=fscanf(fid,'%i',1); for q=1:qty %qty n = fscanf(fid,'%f %f %f %f \n',4)'; % dist, angle, vel A, vel Missile xa=n(1); angle=n(2); va=n(3); vm=n(4); [t]=Armageddon(xa,angle,va,vm) ; assert(isequal(t,t_expect(q))) end fclose(fid); toc

t = 0 t = -1 t = 20.5500 t = -1 t = -1 t = 28.3800 t = -1 t = 11.0300 t = 2.6200 t = 4.2200 t = 13.1500 t = 9.9400 t = 61.3300 t = 13.5600 t = -1 Elapsed time is 0.221032 seconds.