Submission #1238148

#TimeUsernameProblemLanguageResultExecution timeMemory
1238148matsakyannnSoccer Stadium (IOI23_soccer)C++20
1.50 / 100
203 ms31876 KiB
#include <bits/stdc++.h> using namespace std; #ifndef ONLINE_JUDGE #define dbg(x) cerr << #x << ' '; print(x); cerr << endl; #else #define dbg(x) #endif void print(int x) {cerr << x;} void print(long long x) {cerr << x;} void print(char x) {cerr << x;} void print(string x) {cerr << x;} void print(double x) {cerr << x;} template <class T> void print(vector <T> x); template <class T> void print(set <T> x); template <class T> void print(multiset <T> x); template <class T, class V> void print(pair <T, V> x); template <class T, class V> void print(map <T, V> x); template <class T> void print(vector <T> x) {cerr << "[ "; for(auto i : x) {print(i); cerr << ' ';} cerr << "]";} template <class T> void print(set <T> x) {cerr << "[ "; for(auto i : x) {print(i); cerr << ' ';} cerr << "]";} template <class T> void print(multiset <T> x) {cerr << "[ "; for(auto i : x) {print(i); cerr << ' ';} cerr << "]";} template <class T, class V> void print(pair <T, V> x) {cerr << "{"; print(x.first); cerr << ' '; print(x.second); cerr << "}";} template <class T, class V> void print(map <T, V> x) {cerr << "[ "; for(auto i : x) {print(i); cerr << ' ';} cerr << "]";} #define ll long long #define pb push_back #define ppb pop_back #define PII pair <int, int> #define PLL pair <ll, ll> #define all(v) (v).begin(), (v).end() #define OK cerr << "OK\n"; #define MP make_pair int dx[4] = {1, -1, 0, 0}; int dy[4] = {0, 0, 1, -1}; const int inf = 1e9; int biggest_stadium(int N, vector <vector <int>> F){ bool okay = 1; for(int i = 0; i < N; i++){ int st = -1; for(int j = 0; j < N; j++){ if(!F[i][j]){ st = j; break; } } if(st == -1) continue; bool tree_on_road = 0; for(int j = st; j < N; j++){ if(F[i][j]){ tree_on_road = 1; continue; } if(tree_on_road) okay = 0; } } for(int j = 0; j < N; j++){ int st = -1; for(int i = 0; i < N; i++){ if(!F[i][j]){ st = i; break; } } if(st == -1) continue; bool tree_on_road = 0; for(int i = st; i < N; i++){ if(F[i][j]){ tree_on_road = 1; continue; } if(tree_on_road) okay = 0; } } if(okay){ int count = 0; for(int i = 0; i < N; i++){ for(int j = 0; j < N; j++){ count += F[i][j]; } } return N * N - count; } return inf; }
#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...