Submission #824671

#TimeUsernameProblemLanguageResultExecution timeMemory
824671tolbiRectangles (IOI19_rect)C++17
Compilation error
0 ms0 KiB
#pragma optimize("Bismillahirrahmanirrahim")
//█▀█─█──█──█▀█─█─█
//█▄█─█──█──█▄█─█■█
//█─█─█▄─█▄─█─█─█─█
//Allahuekber
//ahmet23 orz...
//FatihSultanMehmedHan
//YavuzSultanSelimHan
//AbdulhamidHan
//Sani buyuk Osman Pasa Plevneden cikmam diyor
#define author tolbi
#include <bits/stdc++.h>
using namespace std;
template<typename X, typename Y> istream& operator>>(istream& is, pair<X,Y> &pr){return is>>pr.first>>pr.second;}
template<typename X, typename Y> ostream& operator<<(ostream& os, pair<X,Y> pr){return os<<pr.first<<" "<<pr.second;}
template<typename T> istream& operator>>(istream& is, vector<T> &arr){for (auto &it : arr) is>>it; return is;}
template<typename T> ostream& operator<<(ostream& os, vector<T> arr){for (auto &it : arr) os<<it<<" "; return os;}
template<typename T,size_t Y> istream& operator>>(istream& is, array<T,Y> &arr){for (auto &it : arr) is>>it; return is;}
template<typename T,size_t Y> ostream& operator<<(ostream& os, array<T,Y> arr){for (auto &it : arr) os<<it<<" "; return os;}
#define deci(x) int x;cin>>x;
#define decstr(x) string x;cin>>x;
#define cinarr(x) for (auto &it : x) cin>>it;
#define coutarr(x) for (auto &it :x) cout<<it<<" ";cout<<endl;
#define sortarr(x) sort(x.begin(), x.end())
#define sortrarr(x) sort(x.rbegin(), x.rend())
#define rev(x) reverse(x.begin(), x.end())
#define tol(bi) (1LL<<((int)(bi)))
typedef long long ll;
const int MOD = 1e9+7;
mt19937 ayahya(chrono::high_resolution_clock().now().time_since_epoch().count());
#include "rect.h"
ll subtask6(vector<vector<int>> &arr){
	int n = arr.size();
	int m = arr[0].size();
	vector<vector<bool>> vis(n,vector<bool>(m,false));
	ll ans = 0;
	function<void(int,int)> dfs;
	dfs = [&](int x, int y){

	};
	for (int i = 0; i < n; i++){
		for (int j = 0; j < m; j++){
			if (arr[i][j]==1) continue;
			if (!vis[i][j]) continue;
			int rx = i;
			bool boolean=true;
			for (int z = i; z < n; z++){
				if (!vis[z][j]){
					boolean=false;
					break;
				}
				if (arr[z][j]==1) break;
				rx=z;
			}
			int ry=j;
			for (int z = j; z < m; z++){
				if (!viz[i][z]){
					boolean=false;
					break;
				}
				if (arr[i][z]==1) break;
				ry=z;
			}
			if (i==0 || i==n-1 || j==0 || j==m-1) boolean=false;
			if (rx==0 || rx==n-1 || ry==0 || ry==m-1) boolean=false;
			if (boolean==false){
				dfs(i,j);
				continue;
			}
			for (int x = i; x <= rx; x++){
				for (int y = j; y <= ry; y++){
					if (arr[x][y]!=0){
						boolean=false;
						break;
					}
				}
				if (!boolean) break;
			}
			for (int x = i; x <= rx; i++){
				if (arr[x][j-1]!=1)boolean=false;
				if (arr[x][ry+1]!=1)boolean=false;
			}
			for (int y = j; y <= ry; y++){
				if (arr[i-1][y]!=1)boolean=false;
				if (arr[rx+1][y]!=1)boolean=false;
			}
			if (boolean) ans++;
			dfs(i,j);
		}
	}
	return ans;
}
long long count_rectangles(vector<vector<int> > a) {
	return subtask6(a);
}

Compilation message (stderr)

rect.cpp:1: warning: ignoring '#pragma optimize ' [-Wunknown-pragmas]
    1 | #pragma optimize("Bismillahirrahmanirrahim")
      | 
rect.cpp: In function 'll subtask6(std::vector<std::vector<int> >&)':
rect.cpp:57:10: error: 'viz' was not declared in this scope; did you mean 'vis'?
   57 |     if (!viz[i][z]){
      |          ^~~
      |          vis