# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
918814 | 2024-01-30T13:16:58 Z | ErJ | 축구 경기장 (IOI23_soccer) | C++17 | 2 ms | 600 KB |
#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; } }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Partially correct | 1 ms | 348 KB | partial |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Runtime error | 2 ms | 600 KB | Execution killed with signal 6 |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Runtime error | 2 ms | 600 KB | Execution killed with signal 6 |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Partially correct | 1 ms | 348 KB | partial |
2 | Runtime error | 2 ms | 600 KB | Execution killed with signal 6 |
3 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Partially correct | 1 ms | 348 KB | partial |
2 | Runtime error | 2 ms | 600 KB | Execution killed with signal 6 |
3 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Partially correct | 1 ms | 348 KB | partial |
2 | Runtime error | 2 ms | 600 KB | Execution killed with signal 6 |
3 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Partially correct | 1 ms | 348 KB | partial |
2 | Runtime error | 2 ms | 600 KB | Execution killed with signal 6 |
3 | Halted | 0 ms | 0 KB | - |