Diff
Not logged in

Differences From Artifact [959cda21c7e42a70]:

To Artifact [a5ea821173c9c755]:


3 3 // O(N) 4 4 // 5 5 // Verified by 6 6 // - SRM 337 Div1 LV3 7 7 // - SRM 486 Div1 LV3 8 8 //------------------------------------------------------------- 9 9 10 -double outer_prod( pt a, pt b ) 11 -{ 12 - return (a.real()*b.imag() - b.real()*a.imag())/2; 13 -} 10 +double outer_prod(const CMP& a, const CMP& b) { return imag(conj(a)*b); } 14 11 15 12 double area( const vector<pt>& q ) 16 13 { 17 14 double a = 0.0; 18 15 19 16 pt o = q[0]; 20 17 for(int i=1; i+1<q.size(); ++i) 21 18 a += outer_prod(q[i]-o, q[i+1]-o); 22 19 return abs(a) / 2; 23 20 }