Submission #1056670

#TimeUsernameProblemLanguageResultExecution timeMemory
1056670Triseedot축구 경기장 (IOI23_soccer)C++17
25 / 100
228 ms47644 KiB
#include <bits/stdc++.h> using namespace std; #ifdef LOCAL #include <debug.h> #else #define debug(...) 42 #endif using ll = long long; #define all(v) v.begin(), v.end() #define len(v) int(v.size()) const ll INF = 1e18; int biggest_stadium(int N, vector<vector<int>> F) { vector<int> row_first(N, -1), row_last(N, -1), col_first(N, -1), col_last(N, -1); int cnt = 0; for (int i = 0; i < N; i++) { for (int j = 0; j < N; j++) { if (!F[i][j]) { cnt++; if (row_last[i] != -1 && row_last[i] != j - 1) { return 0; } row_last[i] = j; if (row_first[i] == -1) row_first[i] = j; } } } for (int i = 0; i < N; i++) { for (int j = 0; j < N; j++) { if (!F[j][i]) { if (col_last[i] != -1 && col_last[i] != j - 1) { return 0; } col_last[i] = j; if (col_first[i] == -1) col_first[i] = j; } } } vector pref_sum(N + 1, vector(N + 1, 0)); for (int i = 0; i < N; i++) { for (int j = 0; j < N; j++) { pref_sum[i + 1][j + 1] = pref_sum[i][j + 1] + pref_sum[i + 1][j] - pref_sum[i][j] + 1 - F[i][j]; } } for (int i = 0; i < N; i++) { for (int j = 0; j < N; j++) { if (!F[i][j]) { debug(i, j); if (pref_sum[col_first[j]][row_first[i]] > 0) { return 0; } if (pref_sum[col_first[j]][N] - pref_sum[col_first[j]][row_last[i] + 1] > 0) { debug(i, j); return 0; } } } } return cnt; }

Compilation message (stderr)

soccer.cpp: In function 'int biggest_stadium(int, std::vector<std::vector<int> >)':
soccer.cpp:7:20: warning: statement has no effect [-Wunused-value]
    7 | #define debug(...) 42
      |                    ^~
soccer.cpp:53:17: note: in expansion of macro 'debug'
   53 |                 debug(i, j);
      |                 ^~~~~
soccer.cpp:7:20: warning: statement has no effect [-Wunused-value]
    7 | #define debug(...) 42
      |                    ^~
soccer.cpp:58:21: note: in expansion of macro 'debug'
   58 |                     debug(i, j);
      |                     ^~~~~
#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...