Submission #223646

#TimeUsernameProblemLanguageResultExecution timeMemory
223646DedMaximAliens (IOI16_aliens)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h>

long long INF = 2e9;

long long cost(int r, int l) {
    return (r - l + 1) * 1ll * (r - l + 1);
}

bool points_comparartor(const std::pair<int, int>& a, const std::pair<int, int>& b) {
    return (a.first == b.first) ? (a.second > b.second) : (a.first < b.first);
}

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 = 1; i <= n; ++i) { 
        for (int x = r[i]; x <= c[i]; ++x) {
            for (int y = r[i]; y <= c[i]; ++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;
}

int main() {
    int n, m, k;
    assert(3 == scanf("%d %d %d", &n, &m, &k));
    std::vector<int> r(n + 1), c(n + 1);
    for (int i = 1; i <= n; i++) {
        assert(2 == scanf("%d %d", &r[i], &c[i]));
        if (r[i] > c[i]) {
            std::swap(r[i], c[i]);
        }
    }
    long long ans = take_photos(n, m, k, r, c);

    printf("%lld\n", ans);
    return 0;
}

Compilation message (stderr)

/tmp/ccgQHR4m.o: In function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'
/tmp/ccTpYa4t.o:aliens.cpp:(.text.startup+0x0): first defined here
/tmp/ccgQHR4m.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