제출 #1299242

#제출 시각아이디문제언어결과실행 시간메모리
1299242lizi14장애물 (IOI25_obstacles)C++20
컴파일 에러
0 ms0 KiB
#include "obstacles.h"
#include <bits/stdc++.h>
using namespace std;
const int N=2e5+5;
long long x[N];
long long n;
void initialize(vector<int> T, vector<int> H) {
    n=H.size();
    int j=0;
    for(int j=0; j<H.size(); j++){
        if(T[0]<=H[j]){
            x[j]=-1;
        }
        else{
            x[j]=1;
        }
        //cout<<x[j]<<" ";
        //x[j]=a;
        //j++;
    }
    return;
}

bool can_reach(long long L, long long R, long long S, long long D) {
    //if(S>D)swap(S,D);
    int kaa=0;
    //S--;
    //D--;
    //cout<<S<<" "<<D<<endl;
    for(int i=S; i<=D; i++){
        if(x[i]==-1){
            kaa=1;
            break;
        }
        // else{
        //     //cout<<x[i]<<" ";
        //     kaa=1;
        //     break;
        // }
    }
    if(kaa==0)return true;
    else return false;
}

컴파일 시 표준 에러 (stderr) 메시지

/usr/bin/ld: /tmp/ccyAIw7A.o: in function `main':
grader.cpp:(.text.startup+0x3e2): undefined reference to `can_reach(int, int, int, int)'
collect2: error: ld returned 1 exit status