Submission #1047430

#TimeUsernameProblemLanguageResultExecution timeMemory
1047430vjudge1Rectangles (IOI19_rect)C++17
37 / 100
5072 ms28440 KiB
#include "rect.h"
#include <bits/stdc++.h>
using namespace std;
long long count_rectangles(std::vector<std::vector<int> > a) {
	long long ans=0;
	int n = a.size();
	int m = a[0].size();
	for(int r1=1;r1<n-1;r1++) {
		for(int r2 = r1;r2<n-1;r2++) {
			for(int c1 = 1;c1<m-1;c1++) {
				for(int c2 = c1;c2<m-1;c2++) {
					bool check=1;
					for(int i = r1;i<=r2;i++) {
						for(int j = c1;j<=c2;j++) {
							if(a[i][j] >= a[i][c1-1] or a[i][j] >= a[i][c2+1] or a[i][j] >= a[r1-1][j] or a[i][j] >= a[r2+1][j]) {
								check=false;
								break;
							}
						}
						if(!check)break;
					}
					ans+=check;
				}
			}
		}
	}
	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...