# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
918814 | ErJ | Soccer Stadium (IOI23_soccer) | C++17 | 2 ms | 600 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define vi vector<ll>
#define vvi vector<vector<ll>>
#define vs vector<string>
#define vc vector<char>
#define vb vector<bool>
#define vp vector<pair<ll, ll>>
#define pp pair<ll, ll>
#define qi queue<ll>
#define qp queue<pp>
#define pqi priority_queue<ll>
#define pqp priority_queue<pp>
#define mi map<ll, ll>
#define mpi map<pp, ll>
#define mip map<ll, pp>
#define mpp map<pp, pp>
#define mb map<ll, bool>
#define si set<ll>
#define sp set<pp>
#define mod 1000000007
#define rep(a, b) for(int a = 0; a < (b); a++)
#define inf 1000000000000000000
bool isOK(int n, vector<vector<int>> F) {
vp okraje(n);
for (int i = 0; i < n; i++) {
int pocet = 0;
for (int j = 1; j < n; j++) {
if (F[i][j] != F[i][j - 1]) {
pocet++;
}
}
if (F[i][n - 1] == 0) pocet++;
if (F[i][0] == 0) pocet++;
if (pocet > 2) {
return 0;
}
okraje[i] = { -1, -1 };
for (int j = 0; j < n; j++) {
if (F[i][j] == 0) {
okraje[i].first = j;
break;
}
}
for (int j = n - 1; j >= 0; j--) {
if (F[i][j] == 0) {
okraje[i].first = j;
break;
}
}
}
for (int i = 0; i < okraje.size(); i++) {
for (int j = 0; j < okraje.size(); j++) {
if (!((okraje[i].first <= okraje[j].first && okraje[i].second >= okraje[j].second) || ((okraje[j].first <= okraje[i].first && okraje[j].second >= okraje[i].second)))) {
return 0;
}
}
}
}
int biggest_stadium(int n, vector<vector<int>> F) {
vector<vector<int>> FT(n);
int ans = 0;
for (int i = 0; i < n; i++) {
FT[i].resize(n);
for (int j = 0; j < n; j++) {
if (F[i][j] == 0) ans++;
FT[i][j] = F[j][i];
}
}
if (isOK(n, F) && isOK(n, FT)) {
return ans;
}
else {
return 0;
}
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |