# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
154394 | bruce_test | Rectangles (IOI19_rect) | C++14 | 4105 ms | 807804 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#pragma GCC optimize "Ofast"
#pragma GCC optimize "unroll-loops"
#pragma GCC target "sse,sse2,sse3,sse4,abm,avx,mmx,popcnt,tune=native"
#include <bits/stdc++.h>
using namespace std;
typedef pair<int, int> pi;
typedef long long ll;
#define f first
#define s second
const int MM = 2505;
int N, M, a[MM][MM], st[MM], top, l[MM], r[MM], u[MM], d[MM], toclear[MM], cnt; ll bit[MM], ans;
vector<pi> h[MM][MM], v[MM][MM];
bool cmp(pi x, pi y){ return x.s < y.s; }
void upd(int x, int val){
for(int i=x; i<MM; i+=i&-i) bit[i] += val;
}
ll qry(int x){
ll sum = 0;
for(int i=x; i; i-=i&-i) sum += bit[i];
return sum;
}
long long count_rectangles(std::vector<std::vector<int>> x){
N = x.size(); M = x[0].size();
for(int i=1; i<=N; i++){
top = 0;
for(int j=1; j<=M; j++){
a[i][j] = x[i-1][j-1];
while(top > 0 && a[i][st[top]] < a[i][j]) top--;
l[j] = st[top]; st[++top] = j;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |