Submission #810373

#TimeUsernameProblemLanguageResultExecution timeMemory
810373NothingXDRectangles (IOI19_rect)C++17
18 / 100
5056 ms28288 KiB
#include "rect.h"
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef double ld;

void debug_out(){cerr<<endl;}
template<typename Head, typename... Tail> 
void debug_out(Head H, Tail... T){
	cerr << H << ' ';
	debug_out(T...);
}

#define debug(...) cerr << "(" << #__VA_ARGS__ << "): ", debug_out(__VA_ARGS__)
#define F first
#define S second
#define all(x) x.begin(), x.end()
#define MP(x, y) make_pair(x, y)



ll count_rectangles(vector<vector<int>> a) {
	int n = a.size();
	int m = a[0].size();
	ll ans = 0;
	for (int i = 1; i < n; i++){
		for (int j = 1; j < m; j++){
			for (int k = i; k + 1 < n; k++){
				for (int l = j; l + 1 < m; l++){
					bool flg = true;
					for (int i2 = i; i2 <= k; i2++){
						for (int j2 = j; j2 <= l; j2++){
							if (min({a[i-1][j2], a[k+1][j2], a[i2][j-1], a[i2][l+1]}) <= a[i2][j2]) flg = false;
						}
					}
					ans += flg;
				}
			}
		}
	}
	return ans;
}

#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...