제출 #223649

#제출 시각아이디문제언어결과실행 시간메모리
223649DedMaximAliens (IOI16_aliens)C++17
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h>

long long take_photos(int n, int m, int k, const std::vector<int>& r, const std::vector<int>& c) {
    std::vector<std::vector<bool>> used(m, std::vector<bool>(m, false));

    for (int i = 0; i < n; ++i) {
        int left = r[i], right = c[i];
        if (left > right)
            std::swap(left, right);

        for (int x = left; x <= right; ++x) {
            for (int y = left; y <= right; ++y) {
                used[x][y] = true;
            }
        }
    }

    long long result = 0;
    for (int x = 0; x != m; ++x) {
        for (int y = 0; y != m; ++y) {
            result += used[x][y];
        }
    }
    return result;
}

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

/tmp/ccTnrGil.o: In function `main':
grader.cpp:(.text.startup+0xdf): undefined reference to `take_photos(int, int, int, std::vector<int, std::allocator<int> >, std::vector<int, std::allocator<int> >)'
collect2: error: ld returned 1 exit status