Submission #840437

# Submission time Handle Problem Language Result Execution time Memory
840437 2023-08-31T11:27:29 Z mohammad_kilani Soccer Stadium (IOI23_soccer) C++17
1.5 / 100
262 ms 31764 KB
#include "soccer.h"
#include <bits/stdc++.h>
using namespace std;

int biggest_stadium(int N, std::vector<std::vector<int>> F){
    vector< pair< int , int > > v;
    int cnt2 = 0 , has2 = 0;
    for(int cnt , has = 0, i = 0 ;i < N;i++){
        cnt = 0;
        has = 0;
        for(int j = 0 ;j < N;j++){
            if(F[i][j] == 0){
                cnt++;
            }
            else{
                if(cnt == 0) continue;
                if(has)
                    return 0;
                has = 1;
                v.push_back(make_pair(cnt , j - 1));
                cnt = 0;
            }
        }
        if(cnt){
            if(has) return 0;
            v.push_back(make_pair(cnt , N - 1));
            has = 1;
        }

        if(has){
            cnt2++;
        }
        else{
            if(cnt2)
                has2++;
            cnt2 = 0;
        }
    }
    if(has2 > 0)
        return 0;
    
    sort(v.begin(),v.end());
    int ans = 0;
    for(int i = 0 ;i < (int)v.size();i++){
        ans += v[i].first;
        v[i].first = v[i].second - v[i].first + 1;
        if(i == 0) continue;

        if(v[i - 1].first < v[i].first || v[i - 1].second > v[i].second)
        return 0;
    }
    return ans;
}
# Verdict Execution time Memory Grader output
1 Partially correct 0 ms 212 KB partial
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB ok
2 Correct 1 ms 212 KB ok
3 Correct 0 ms 212 KB ok
4 Correct 0 ms 212 KB ok
5 Correct 0 ms 212 KB ok
6 Partially correct 0 ms 212 KB partial
7 Partially correct 1 ms 340 KB partial
8 Partially correct 16 ms 2260 KB partial
9 Partially correct 262 ms 31764 KB partial
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB ok
2 Correct 1 ms 212 KB ok
3 Partially correct 0 ms 212 KB partial
4 Incorrect 0 ms 212 KB wrong
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Partially correct 0 ms 212 KB partial
2 Correct 1 ms 212 KB ok
3 Correct 1 ms 212 KB ok
4 Partially correct 0 ms 212 KB partial
5 Incorrect 0 ms 212 KB wrong
6 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Partially correct 0 ms 212 KB partial
2 Correct 1 ms 212 KB ok
3 Correct 1 ms 212 KB ok
4 Correct 0 ms 212 KB ok
5 Correct 0 ms 212 KB ok
6 Partially correct 0 ms 212 KB partial
7 Incorrect 0 ms 212 KB wrong
8 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Partially correct 0 ms 212 KB partial
2 Correct 1 ms 212 KB ok
3 Correct 1 ms 212 KB ok
4 Correct 0 ms 212 KB ok
5 Correct 0 ms 212 KB ok
6 Partially correct 0 ms 212 KB partial
7 Incorrect 0 ms 212 KB wrong
8 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Partially correct 0 ms 212 KB partial
2 Correct 1 ms 212 KB ok
3 Correct 1 ms 212 KB ok
4 Correct 0 ms 212 KB ok
5 Correct 0 ms 212 KB ok
6 Correct 0 ms 212 KB ok
7 Partially correct 0 ms 212 KB partial
8 Partially correct 1 ms 340 KB partial
9 Partially correct 16 ms 2260 KB partial
10 Partially correct 262 ms 31764 KB partial
11 Partially correct 0 ms 212 KB partial
12 Incorrect 0 ms 212 KB wrong
13 Halted 0 ms 0 KB -