/*
ID: Sho10
LANG: C++
*/
#include <bits/stdc++.h> //Andrei Alexandru a.k.a Sho10
#define ll long long int
#pragma GCC optimize("O3")
#pragma GCC optimize("Ofast")
#define all(a) (a).begin(), (a).end()
#define sz size
#define f first
#define s second
#define pb push_back
#define er erase
#define in insert
#define mp make_pair
#define pi pair
#define rc(s) return cout<<s,0
#define endl '\n'
#define mod 1000000007
#define PI 3.14159265359
#define CODE_START ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
using namespace std;
ll a[2505][2505];
ll count_rectangles(vector<vector<int> >A){
ll n=A.size();
ll m=A[0].size();
ll ans=0;
for(ll i=0;i<n;i++)
for(ll j=0;j<m;j++)
a[i][j]=A[i][j];
for(ll i=1;i<n-1;i++)
for(ll j=1;j<m-1;j++)
{
for(ll c=i;c<n-1;c++)
for(ll k=j;k<m-1;k++){
if(a[c][k]<a[c-1][k]&&a[c][k]<a[c][k-1]&&a[c][k]<a[c+1][k]&&a[c][k]<a[c][k+1]){
ans++;
}else break;
}
}
return ans;
}
int32_t main(){
CODE_START;
cout<<count_rectangles({{4, 8, 7, 5, 6},{7, 4, 10, 3, 5},{9, 7, 20, 14, 2},{9, 14, 7, 3, 6},{5, 7, 5, 2, 7},{4, 5, 13, 5, 6}});
}
Compilation message
/tmp/ccbkbQFI.o: In function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'
/tmp/cclAI4sx.o:rect.cpp:(.text.startup+0x0): first defined here
collect2: error: ld returned 1 exit status