제출 #1078289

#제출 시각아이디문제언어결과실행 시간메모리
1078289PanosPaskSoccer Stadium (IOI23_soccer)C++17
0 / 100
1 ms348 KiB
#include "soccer.h" using namespace std; vector<vector<int>> grid; vector<bool> empty_row; vector<vector<int>> rotated; vector<bool> empty_column; bool check_row(vector<int>& r, vector<bool>& place, int pos) { bool started = false; bool ended = false; for (int i = 0; i < r.size(); i++) { if (r[i] == 0) { if (ended) { return false; } if (!started) { started = true; } } else { if (started) { ended = true; } } } place[pos] = started; return true; } int biggest_stadium(int N, std::vector<std::vector<int>> F) { grid.resize(N, vector<int>(N)); rotated.resize(N, vector<int>(N)); empty_column.resize(N); empty_row.resize(N); int tot = 0; for (int i = 0; i < N; i++) { for (int j = 0; j < N; j++) { grid[i][j] = F[i][j]; rotated[j][i] = F[i][j]; tot += !F[i][j]; } } bool good = true; for (int i = 0; i < N; i++) { good = good && check_row(grid[i], empty_row, i) && check_row(rotated[i], empty_column, i); } if (!good) { return 0; } for (int i = 0; i < N; i++) { for (int j = 0; j < N; j++) { if (empty_row[i] && empty_column[j]) { if (F[i][j] && F[j][i]) { return 0; } } } } return tot; }

컴파일 시 표준 에러 (stderr) 메시지

soccer.cpp: In function 'bool check_row(std::vector<int>&, std::vector<bool>&, int)':
soccer.cpp:16:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   16 |     for (int i = 0; i < r.size(); i++) {
      |                     ~~^~~~~~~~~~
#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...