제출 #397729

#제출 시각아이디문제언어결과실행 시간메모리
397729ly20Rectangles (IOI19_rect)C++17
10 / 100
6 ms460 KiB
 #include "rect.h"
#include <bits/stdc++.h>
using namespace std;


const int MAXN = 2512, MAXK = 13;
int n, m;
int tb[MAXN][MAXN];
long long count_rectangles(vector<vector<int> > ts) {
	n = ts.size();
	m = ts[0].size();
	if(n < 3 || m < 3) return 0;
    long long resp = 0;
	for(int i = 0; i < n; i++) {
        for(int j = 0; j < m; j++) {
            tb[i + 1][j + 1] = ts[i][j];
        }
	}
    for(int i = 2; i < m; i++) {
        int mn = 0;
        for(int j = i; j < m; j++) {
            mn = max(tb[2][j], mn);
            if(tb[2][j] >= tb[1][j] || tb[2][j] >= tb[3][j]) break;
            if(mn < tb[2][i - 1] && mn < tb[2][j + 1]) resp++;
        }
    }
	return resp;
}

#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...