# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
897093 | irmuun | Soccer Stadium (IOI23_soccer) | C++17 | 275 ms | 35852 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<bits/stdc++.h>
#include "soccer.h"
using namespace std;
#define ll long long
#define pb push_back
#define ff first
#define ss second
#define all(s) s.begin(),s.end()
#define rall(s) s.rbegin(),s.rend()
int biggest_stadium(int n,vector<vector<int>>F){
vector<pair<int,int>>u;
int total=0;
bool ok=true;
for(int i=0;i<n;i++){
vector<int>v;
for(int j=0;j<n;j++){
if(F[i][j]==0){
total++;
v.pb(j);
}
}
for(int j=1;j<v.size();j++){
if(v[j-1]+1!=v[j]){
ok=false;
}
}
if(v.size()>0){
u.pb({v[0],v.back()});
}
}
for(int j=0;j<n;j++){
vector<int>v;
for(int i=0;i<n;i++){
if(F[i][j]==0){
v.pb(i);
}
}
for(int i=1;i<v.size();i++){
if(v[i-1]+1!=v[i]){
ok=false;
}
}
}
for(auto x:u){
for(auto y:u){
if(x.ss<y.ff||y.ss<x.ff){
ok=false;
}
}
}
if(!ok){
if(total==1){
return 2;
}
return 1;
}
return total;
}
Compilation message (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... |