Submission #844901

# Submission time Handle Problem Language Result Execution time Memory
844901 2023-09-06T08:11:27 Z coding_snorlax Soccer Stadium (IOI23_soccer) C++17
Compilation error
0 ms 0 KB
#include<bits/stdc++.h>
using namespace std;
pair<int,int> process(vector<int> S){
    int L=-1,R=-1,flag = 1;
    for(int i=0;i<(int)S.size();i++){
        if(!S[i] && L==-1){
            L = i; R = i;
        }
        else if(!S[i] && R==i-1){
            R=i;
        }
        else if(!S[i]){
            flag = 0;
        }
    }
    if(!flag) return make_pair(-2,-2);
    return make_pair(L,R);
}
int check_Left(vector<int> List){
    int answer=1,down=0,flag = 0, Last = -1 , next_level = 0;
    for(int i:List){
        if(i==-2) answer=0;
        else if(i==-1 && Last!=-1) flag = 1;
        else{
            if(flag) answer = 0;
            if(Last==-1) Last = i;
            else{
                if(i>Last && next_level==0) next_level = 1;
                else if(i<Last && next_level==1) answer = 0;
            }
            Last = i;
        }

    }
    if(down > 1 || answer==0) return 0;
    else return 1;
}
int main(){
    vector<int> T = {1,1,0,0,0,1,1,1,1};
    pair<int,int> s = process(T);
    cout << s.first << " " << s.second << "\n";
    vector<int> T2 = {4,2,3};
    cout << check_Left(T2);
}

Compilation message

/usr/bin/ld: /tmp/ccjXX6OY.o: in function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/ccQVWl6Y.o:soccer.cpp:(.text.startup+0x0): first defined here
/usr/bin/ld: /tmp/ccjXX6OY.o: in function `main':
grader.cpp:(.text.startup+0x4ac): undefined reference to `biggest_stadium(int, std::vector<std::vector<int, std::allocator<int> >, std::allocator<std::vector<int, std::allocator<int> > > >)'
collect2: error: ld returned 1 exit status