Topcoder High School SRM 5 250 pt - Level one - TV Size problem editorial: http://community.topcoder.com/tc?module=Static&d1=hs&d2=match_editorials&d3=hs_srm5
Topcoder High School SRM 5 250 pt - Level one - TV Size problem solution:
#include <iostream> #include <vector> #include <cmath> using namespace std; class TVSize { public: vector <int> calcSize(int d, int h, int w) { double a, r; vector <int> v; a=(double)sqrt(h*h + w*w); r=(double)d/a; v.push_back(h*r), v.push_back(w*r); return v; } };
No comments:
Post a Comment