Submission #555416

# Submission time Handle Problem Language Result Execution time Memory
555416 2022-04-30T21:26:27 Z MohamedFaresNebili Vision Program (IOI19_vision) C++14
Compilation error
0 ms 0 KB
#include <bits/stdc++.h>
#include 'vision.h'
/// #pragma GCC optimize ("Ofast")
/// #pragma GCC target ("avx2")
/// #pragma GCC optimize("unroll-loops")

        using namespace std;

        using ll = long long;
        using ii = pair<ll, ll>;
        using vi = vector<int>;

        #define ff first
        #define ss second
        #define pb push_back
        #define all(x) (x).begin(), (x).end()
        #define lb lower_bound
        /// #define int ll

        const int oo = 1e9 + 7;

        int n, m; map<ii, int> vis;
        int calc(int x, int y) {
            return x * m + y;
        }
        int dist(int x, int y, int xx, int yy) {
            return abs(x - xx) + abs(y - yy);
        }

        void construct_network(int H, int W, int K) {
            n = H, m = W; vector<int> res;
            for(int l = 0; l < n; l++) {
                for(int i = 0; i < m; i++) {
                    /// for(int j = 0; j < n; j++) {
                        /// for(int k = 0; k < m; k++) {
                            /// int d = dist(l, i, j, k);
                            /// int a = calc(l, i), b = calc(j, k);
                            /// if(a > b) swap(a, b);
                            if(l + i == K) {
                                res.pb(add_and({0, calc(l, i)}));
                                /// vis[{a, b}] = 1;
                            }
                        }
                    /// }
                /// }
            }
            add_or(res);
        }

Compilation message

vision.cpp:2:10: error: #include expects "FILENAME" or <FILENAME>
    2 | #include 'vision.h'
      |          ^~~~~~~~~~
vision.cpp: In function 'void construct_network(int, int, int)':
vision.cpp:40:40: error: 'add_and' was not declared in this scope
   40 |                                 res.pb(add_and({0, calc(l, i)}));
      |                                        ^~~~~~~
vision.cpp:47:13: error: 'add_or' was not declared in this scope
   47 |             add_or(res);
      |             ^~~~~~