Submission #289483

#TimeUsernameProblemLanguageResultExecution timeMemory
289483MarcoMeijerRectangles (IOI19_rect)C++14
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> #include "rect.h" #include "grader.cpp" using namespace std; //macros typedef long long ll; typedef pair<int, int> ii; typedef pair<ll, ll> lll; typedef tuple<int, int, int> iii; typedef vector<int> vi; typedef vector<ii> vii; typedef vector<iii> viii; typedef vector<ll> vll; typedef vector<lll> vlll; #define REP(a,b,c) for(int a=int(b); a<int(c); a++) #define RE(a,c) REP(a,0,c) #define RE1(a,c) REP(a,1,c+1) #define REI(a,b,c) REP(a,b,c+1) #define REV(a,b,c) for(int a=int(c-1); a>=int(b); a--) #define FOR(a,b) for(auto& a : b) #define INF 1e9 #define pb push_back #define fi first #define se second #define sz size() const int MX=2502; int n, m; set<int> difW[MX][MX]; set<int> difH[MX][MX]; bool possible(int x, int y, int w, int h) { RE(i,w) if(!difH[x+i][y].count(h)) return 0; RE(i,h) if(!difW[x][y+i].count(w)) return 0; return 1; } long long count_rectangles(vector<vi> a) { n = a.sz; m = a[0].sz; RE(i,n) { stack<int> stck; RE(j,m) { while(!stck.empty() && a[i][stck.top()] < a[i][j]) { stck.pop(); if(!stck.empty()) { difH[i][stck.top()+1].insert(j-stck.top()-1); } } if(!stck.empty() && a[i][stck.top()] == a[i][j]) stck.pop(); stck.push(j); } } RE(j,m) { stack<int> stck; RE(i,n) { while(!stck.empty() && a[stck.top()][j] < a[i][j]) { stck.pop(); if(!stck.empty()) { difW[stck.top()+1][j].insert(i-stck.top()-1); } } if(!stck.empty() && a[stck.top()][j] == a[i][j]) stck.pop(); stck.push(i); } } ll ans = 0; RE(i,n) RE(j,m) { FOR(w,difW[i][j]) FOR(h,difH[i][j]) { if(possible(i,j,w,h)) ans++; } } return ans; }

Compilation message (stderr)

/tmp/ccXrKvAx.o: In function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'
/tmp/ccsl4A7i.o:rect.cpp:(.text.startup+0x0): first defined here
collect2: error: ld returned 1 exit status