Submission #362223

#TimeUsernameProblemLanguageResultExecution timeMemory
362223knightron0Rectangles (IOI19_rect)C++14
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; #define pb push_back #define fr first #define sc second #define clr(a, x) memset(a, x, sizeof(a)) #define dbg(x) cout<<"("<<#x<<"): "<<x<<endl; #define printvector(arr) for (auto it = arr.begin(); it != arr.end(); ++it) cout<<*it<<" "; cout<<endl; #define all(v) v.begin(), v.end() #define lcm(a, b) (a * b)/__gcd(a, b) #define int long long #define printvecpairs(vec) for(auto it: vec) cout<<it.fr<<' '<<it.sc<<endl; #define endl '\n' #define float long double const int MOD = 1e9 + 7; const int INF = 2e15; const int MAXN = 1e5 + 5; int count_rectangles(vector<vector<int>> a) { int n = a[0].size(); bool poss[n+2]; clr(poss, 0); for(int i= 1;i<n-1;i++){ if(a[1][i] < a[0][i] && a[1][i] < a[2][i]){ poss[i] = 1; } } int ans= 0; for(int i= 0;i<n;i++){ int mx = 0; int sum = 0; for(int j=i+2;j<n;j++){ mx = max(mx, a[1][j-1]); sum += poss[j-1]; int len = j-i-1; if(sum == len && mx < min(a[1][i], a[1][j])){ ans++; } } } return ans; } /* signed main() { ios_base::sync_with_stdio(false); cin.tie(NULL); #ifdef LOCAL freopen("input.txt", "r", stdin); #endif int n, m; cin>>n>>m; vector<vector<int>> vec; for(int i= 0;i<n;i++){ vector<int> tmp; for(int j= 0;j<m;j++){ int x; cin>>x; tmp.pb(x); } vec.pb(tmp); } cout<<count_rectangles(vec)<<endl; return 0; } */

Compilation message (stderr)

/tmp/ccz1qXfH.o: In function `main':
grader.cpp:(.text.startup+0x720): undefined reference to `count_rectangles(std::vector<std::vector<int, std::allocator<int> >, std::allocator<std::vector<int, std::allocator<int> > > >)'
collect2: error: ld returned 1 exit status