Submission #401811

# Submission time Handle Problem Language Result Execution time Memory
401811 2021-05-10T21:06:08 Z timmyfeng Amusement Park (JOI17_amusement_park) C++17
Compilation error
0 ms 0 KB
#include <bits/stdc++.h>
using namespace std;

#include <Joi.h>
 
void Joi(int n, int m, vector<int> a, vector<int> b, long long x, int t) {
    vector<vector<int>> adj(n);
    for (int i = 0; i < m; ++i) {
        adj[a[i]].push_back(b[i]);
        adj[b[i]].push_back(a[i]);
    }
 
    vector<bool> visited(n);
    auto dfs = [&](int u, auto &self) -> void {
        MessageBoard(u, x % 2);
        x /= 2;
 
        visited[u] = true;
        for (auto c : adj[u]) {
            if (!visited[c]) {
                self(c, self);
            }
        }
    };
 
    dfs(1, dfs);
}
#include <bits/stdc++.h>
using namespace std;

#include <Ioi.h>
 
const int L = 60;

long long Ioi(int n, int m, vector<int> a, vector<int> b, int p, int v, int t) {
    vector<vector<int>> adj(n);
    for (int i = 0; i < m; ++i) {
        adj[a[i]].push_back(b[i]);
        adj[b[i]].push_back(a[i]);
    }

    vector<int> path;
    vector<bool> visited(n);
    auto dfs_find = [&](int u, auto &self) -> bool {
        visited[u] = true;
        if (u == 1) {
            return true;
        }

        for (auto c : adj[u]) {
            if (!visited[c] && self(c, self)) {
                path.push_back(c);
                return true;
            }
        }
        return false;
    };

    dfs_find(p, dfs_find);

    reverse(path.begin(), path.end());
    for (auto u : path) {
        v = Move(u);
    }

    int i = 0;
    long long ans = 0;
    visited.assign(n, false);
    auto dfs_read = [&](int u, auto &self) -> bool {
        ans |= (long long) v << i;
        if (++i == L) {
            return true;
        }

        visited[u] = true;
        for (auto c : adj[u]) {
            if (!visited[c]) {
                v = Move(c);
                if (self(c, self)) {
                    return true;
                }
                v = Move(u);
            }
        }
    };

    dfs_read(1, dfs_read);

    return ans;
}

Compilation message

/usr/bin/ld: /tmp/ccHEjGFX.o: in function `main':
grader_joi.cpp:(.text.startup+0x1ae): undefined reference to `Joi(int, int, int*, int*, long long, int)'
collect2: error: ld returned 1 exit status

Ioi.cpp: In lambda function:
Ioi.cpp:58:5: warning: control reaches end of non-void function [-Wreturn-type]
   58 |     };
      |     ^
/usr/bin/ld: /tmp/cc2MyDsH.o: in function `main':
grader_ioi.cpp:(.text.startup+0x3f2): undefined reference to `Ioi(int, int, int*, int*, int, int, int)'
collect2: error: ld returned 1 exit status