# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
930086 | abcvuitunggio | Soccer Stadium (IOI23_soccer) | C++17 | 763 ms | 147684 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "soccer.h"
#include <bits/stdc++.h>
using namespace std;
const int mxn=2006;
int ans,dp[mxn][mxn],l[mxn][mxn],u[mxn][mxn],d[mxn][mxn],r[mxn][mxn],L[mxn],R[mxn],h[mxn][mxn],w[mxn][mxn],a[mxn][mxn];
vector <int> ve[mxn];
int biggest_stadium(int n, vector <vector <int>> F){
for (int i=0;i<n;i++)
for (int j=0;j<n;j++){
l[i][j]=(j&&!F[i][j-1]?l[i][j-1]:j);
r[i][j]=(j<n-1&&!F[i][j+1]);
d[i][j]=n-1;
}
for (int j=n-1;j>=0;j--){
stack <int> st;
for (int i=0;i<n;i++){
if (!F[i][j])
ve[l[i][j]].push_back(i);
while (!st.empty()&&(F[i][j]||l[i][j]>l[st.top()][j])){
d[st.top()][j]=i-1;
st.pop();
}
L[i]=(st.empty()?-1:st.top());
if (!F[i][j])
st.push(i);
}
while (!st.empty())
st.pop();
for (int i=n-1;i>=0;i--){
while (!st.empty()&&(F[i][j]||l[i][j]>l[st.top()][j])){
# | 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... |