# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1084800 | thangdz2k7 | 축구 경기장 (IOI23_soccer) | C++17 | 1 ms | 348 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
// author : thembululquaUwU
// 3.9.2024
#include <bits/stdc++.h>
#define left __left__
#define right __right__
#define pb push_back
#define fi first
#define se second
#define endl '\n'
using namespace std;
using ll = long long;
using ii = pair <int, int>;
using vi = vector <int>;
const int MaxN = 2e5;
const int mod = 1e9 + 7;
void maxl(auto &a, auto b) {a = max(a, b);}
void minl(auto &a, auto b) {a = min(a, b);}
int biggest_stadium(int n, vector <vi> f){
vector <int> dp(n), h(n);
vector <vi> cur(n); int res = 0;
for (int r = 0; r < n; ++ r){
for (int c = 0; c < n; ++ c){
if (f[r][c]){
h[c] = -1;
dp[c] = 0;
}
else cur[++ h[c]].pb(c);
}
vi left(n), right(n);
stack <int> stk;
for (int c = 0; c < n; ++ c){
while (stk.size() && h[c] <= h[stk.top()]) stk.pop();
left[c] = stk.empty() ? -1 : stk.top();
stk.push(c);
}
while (stk.size()) stk.pop();
for (int c = n - 1; c >= 0; -- c){
while (stk.size() && h[c] <= h[stk.top()]) stk.pop();
right[c] = stk.empty() ? n : stk.top();
stk.push(c);
}
for (int hh = 0; hh < n; ++ hh){
for (int c : cur[hh]){
int len = right[c] - left[c] - 1;
dp[c] += len;
if (left[c] > -1) maxl(dp[c], dp[left[c]] + len * (h[c] - h[left[c]]));
if (right[c] < n) maxl(dp[c], dp[right[c]] + len * (h[c] - h[right[c]]));
maxl(res, dp[c]);
}
}
}
return res;
}
컴파일 시 표준 에러 (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... |