Submission #622420

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
6224202022-08-04 09:20:00JomnoiRectangles (IOI19_rect)C++17
50 / 100
5038 ms140296 KiB
#include <bits/stdc++.h>
#include "rect.h"
using namespace std;
const int MAX_N = 2505;
const int d[4][2] = {{-1, 0}, {0, -1}, {1, 0}, {0, 1}};
int N, M;
long long ans;
vector <vector <int>> A;
vector <vector <vector <bool>>> validRow, validCol;
int qs[MAX_N][MAX_N], dp[MAX_N];
bool visited[MAX_N][MAX_N];
long long count_rectangles(vector <vector <int>> a) {
N = a.size(), M = a[0].size();
A.resize(N + 1, vector <int> (M + 1, 0));
if(min(N, M) < 3) {
return 0;
}
for(int i = 0; i < N; i++) {
for(int j = 0; j < M; j++) {
A[i + 1][j + 1] = a[i][j];
}
}
if((N <= 700 and M <= 700) or (N <= 3 and M <= 2500)) {
validRow.resize(N + 1, vector <vector <bool>> (M + 1, vector <bool> (M + 1, false)));
validCol.resize(M + 1, vector <vector <bool>> (N + 1, vector <bool> (N + 1, false)));
 
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#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...