标签:public 计算 point solution ges IV color code span
1 static int wing=[]() 2 { 3 std::ios::sync_with_stdio(false); 4 cin.tie(NULL); 5 return 0; 6 }(); 7 8 class Solution 9 { 10 public: 11 double largestTriangleArea(vector<vector<int>>& points) 12 { 13 double res=0; 14 for(auto &i:points) 15 for(auto &j:points) 16 for(auto &k:points) 17 res=max(res,0.5*abs(i[0]*j[1]+j[0]*k[1]+k[0]*i[1]-j[0]*i[1]-k[0]*j[1]-i[0]*k[1])); 18 return res; 19 } 20 };
暴力解法,用了下二维平面中给出三个点坐标计算三角形面积的公式
标签:public 计算 point solution ges IV color code span
原文地址:https://www.cnblogs.com/zhuangbijingdeboke/p/9184345.html