제출 #1238074

#제출 시각아이디문제언어결과실행 시간메모리
1238074matsakyannnSoccer Stadium (IOI23_soccer)C++20
1.50 / 100
188 ms31772 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}; int biggest_stadium(int N, vector <vector <int>> F){ bool flag = 1; int count_trees = 0; for(int i = 0; i < N; i++){ for(int j = 0; j < N; j++){ if(!F[i][j]) continue; count_trees++; int cnt = 0; for(int t = 0; t < 4; t++){ int nx = i + dx[t], ny = j + dy[t]; if(nx < 0 || ny < 0 || nx >= N || ny >= N){ //dbg(MP(i, j)); cnt++; continue; } cnt += F[nx][ny]; } if(cnt <= 1){ //dbg(MP(i, j)); flag = 0; } } } if(flag) return N * N - count_trees; return 1000000; }
#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...