Submission #1080541

#TimeUsernameProblemLanguageResultExecution timeMemory
1080541shmaxSoccer Stadium (IOI23_soccer)C++17
1.50 / 100
231 ms32256 KiB
#include "soccer.h" #include "bits/stdc++.h" using namespace std; using i32 = int; #define int long long #define len(x) (int)(x.size()) #define all(x) x.begin(), x.end() #define inf 1000'000'000'000'000'000LL #define bit(x, i) (((x) >> i) & 1) template<typename T> using vec = vector<T>; i32 biggest_stadium(i32 n, std::vector<std::vector<i32>> F) { int cnt = 0; for (int i = 0; i < n; i++) { for (int j = 0; j < n; j++) { cnt += F[i][j] == 0; } } vec<vec<bool>> used(n, vec<bool>(n, false)); for (int i = 1; i < n; i++) { for (int j = 0; j < n; j++) { if (used[i][j]) continue; if (!F[i][j]) continue; if (F[i - 1][j] == 0) { for (int k = i; k < n; k++) { if (F[k][j] == 0) return 0; used[k][j] = true; } } } } used = vec<vec<bool>>(n, vec<bool>(n, false)); for (int i = 0; i < n; i++) { for (int j = 1; j < n; j++) { if (used[i][j]) continue; if (!F[i][j]) continue; if (F[i][j - 1] == 0) { for (int k = j; k < n; k++) { if (F[i][k] == 0) return 0; used[i][k] = true; } } } } return cnt; }
#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...