Submission #957159

#TimeUsernameProblemLanguageResultExecution timeMemory
957159duckindogAliens (IOI16_aliens)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; #ifndef LOCAL #include "aliens.h" #endif int64_t take_photos(int n, int m, int k, vector<int> r, vector<int> c) { using pii = pair<int, int>; vector<pii> p(n); vector<vector<int64_t>> f(k + 1, vector<int64_t>(n + 1, 1e15)); for (int i = 0; i < n; ++i) p[i] = {r[i], c[i]}; if (n <= 50 && m <= 100 && k == n) { vector<vector<bool>> mk(m, vector<bool>(m)); for (int i = 0; i < n; ++i) { auto [x, y] = p[i]; if (x > y) swap(x, y); for (int i = x; i <= y; ++i) { for (int j = x; j <= y; ++j) mk[i][j] = true; } } int answer = 0; for (int i = 0; i < m; ++i) for (int j = 0; j < m; ++j) answer += mk[i][j]; return answer; } auto dis = [&](pii a) { return abs(a.first - a.second) + 1; }; sort(p.begin(), p.end(), [&](const auto& a, const auto& b) { return make_pair(a.first, dis(a)) < make_pair(b.first, dis(b)); }); return 0; } #ifdef LOCAL int32_t main() { cin.tie(0)->sync_with_stdio(0); int n, m, k; cin >> n >> m >> k; vector<int> r(n), c(n); for (int i = 0; i < n; ++i) cin >> r[i] >> c[i]; cout << take_photos(n, m, k, r, c) << "\n"; } #endif

Compilation message (stderr)

aliens.cpp:9:9: error: ambiguating new declaration of 'int64_t take_photos(int, int, int, std::vector<int>, std::vector<int>)'
    9 | int64_t take_photos(int n, int m, int k, vector<int> r, vector<int> c) {
      |         ^~~~~~~~~~~
In file included from aliens.cpp:6:
aliens.h:5:11: note: old declaration 'long long int take_photos(int, int, int, std::vector<int>, std::vector<int>)'
    5 | long long take_photos(int n, int m, int k, std::vector<int> r, std::vector<int> c);
      |           ^~~~~~~~~~~