제출 #1269327

#제출 시각아이디문제언어결과실행 시간메모리
1269327sula2Obstacles for a Llama (IOI25_obstacles)C++20
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h>
using namespace std;

vector<int> T,H;
int n,m;
bool valid(int i, int j) {
    return 0 <= min(i, j) && i < n && j < m && T[i] > H[j] && comp[i][j] == 0;
}
set<int> blocked;

void initialize(vector<int> _T, vector<int> _H) {
    n = _T.size();
    m = _H.size();
    T = _T, H = _H;
    for (int j = 0; j < n; j++) {
        if (T[n-1] <= H[j]) {
            blocked.insert(j);
        }
    }
}

bool can_reach(int l, int r, int s, int t) {
    auto it = blocked.lower_bound(s);
    return it == blocked.end() || *it > t;
}

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

obstacles.cpp: In function 'bool valid(int, int)':
obstacles.cpp:7:63: error: 'comp' was not declared in this scope
    7 |     return 0 <= min(i, j) && i < n && j < m && T[i] > H[j] && comp[i][j] == 0;
      |                                                               ^~~~