// short int long float double bool char string void // array vector stack queue auto const operator // class public private static friend extern // sizeof new delete return cout cin memset malloc // relloc size length memset malloc relloc size length // for while if else switch case continue break system // endl reverse sort swap substr begin end iterator // namespace include define NULL nullptr exit equals // index col row arr err left right ans res vec que sta // state flag ch str max min default charray std // maxn minn INT_MAX INT_MIN push_back insert #include usingnamespace std; typedeflonglong ll; typedef pair<int,int>PII; typedef pair<int, string>PIS; constint maxn&#61;1e6&#43;50;//注意修改大小 longlongread(){longlong x&#61;0,f&#61;1;char c&#61;getchar();while(!isdigit(c)){if(c&#61;&#61;&#39;-&#39;) f&#61;-1;c&#61;getchar();}while(isdigit(c)){x&#61;x*10&#43;c-&#39;0&#39;;c&#61;getchar();}return x*f;} ll qpow(ll x,ll q,ll Mod){ll ans&#61;1;while(q){if(q&1)ans&#61;ans*x%Mod;q>>&#61;1;x&#61;(x*x)%Mod;}return ans%Mod;}classSolution{ public:intprojectionArea(vector<vector<int>>& grid){int ans&#61;0,n&#61;grid.size(),m&#61;grid[0].size();for(auto a:grid){for(auto v:a){ans&#43;&#61;(v!&#61;0);}}for(auto a:grid){int maxx&#61;0;for(auto v:a){maxx&#61;max(maxx,v);}ans&#43;&#61;maxx;}for(int j&#61;0;j<m;j&#43;&#43;){int maxx&#61;0;for(int i&#61;0;i<n;i&#43;&#43;){maxx&#61;max(maxx,grid[i][j]);}ans&#43;&#61;maxx;}return ans;} };