QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#806258#8642. Spy 3topfloorboss#Compile Error//C++203.7kb2024-12-09 01:33:342024-12-09 01:33:34

Judging History

你现在查看的是最新测评结果

  • [2024-12-09 01:33:34]
  • 评测
  • [2024-12-09 01:33:34]
  • 提交

Aoi

#include "Aoi.h"
#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <string>
#include <bitset>
#include <iterator>
#include <iomanip>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <ctime>
#include <deque>
#include <queue>
#include <stack>
#include <random>
#include <cassert>

using namespace std;

namespace {

std::string aoi(int n, int m, int q, int k, std::vector<int> a,
                std::vector<int> b, std::vector<long long> c,
                std::vector<int> t, std::vector<int> x) {
    string ans(k * q, '0');
    vector<vector<pair<pair<int, long long>, int>>> gr(n);
    for (int i = 0; i < m; ++i) {
        gr[a[i]].push_back({{b[i], c[i]}, i});
        gr[b[i]].push_back({{a[i], c[i]}, i});
    }
    vector<long long> d(n, 1e15);
    vector<int> p(n), indp(n);
    d[0] = 0;
    p[0] = -1;
    set<pair<long long, int>> cur;
    for (int i = 0; i < n; ++i) cur.insert({d[i], i});
    while (cur.size()) {
        int v = (*cur.begin()).second;
        cur.erase(cur.begin());
        for (auto e : gr[v]) {
            int u = e.first.first, w = e.first.second, ind = e.second;
            if (d[u] > d[v] + w) {
                cur.erase({d[u], u});
                d[u] = d[v] + w;
                cur.insert({d[u], u});
                p[u] = v;
                indp[u] = ind;
            }
        }
    }
    for (int i = 0; i < q; ++i) {
        vector<bool> used(m);
        int v = t[i];
        while (v != 0) {
            used[indp[v]] = 1;
            v = p[v];
        }
        for (int j = 0; j < k; ++j) {
            if (used[x[j]]) {
                ans[i * k + j] = '1';
            }
        }
    }
    return ans;
}
}

Bitaro

#include "Bitaro.h"
#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <string>
#include <bitset>
#include <iterator>
#include <iomanip>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <ctime>
#include <deque>
#include <queue>
#include <stack>
#include <random>
#include <cassert>

using namespace std;

namespace {

void bitaro(int n, int m, int q, int k, std::vector<int> a, std::vector<int> b,
            std::vector<long long> c, std::vector<int> t, std::vector<int> x,
            std::string s) {
    for (int i = 0; i < q; ++i) {
        for (auto i : x) c[i] = -1;
        for (int j = 0; j < k; ++j) {
            if (s[i * k + j] == '1') {
                c[x[j]] = 0;
            }
        }
        vector<vector<pair<pair<int, long long>, int>>> gr(n);
        for (int i = 0; i < m; ++i) {
            gr[a[i]].push_back({{b[i], c[i]}, i});
            gr[b[i]].push_back({{a[i], c[i]}, i});
        }
        vector<long long> d(n, 1e15);
        vector<int> p(n), indp(n);
        d[0] = 0;
        p[0] = -1;
        set<pair<long long, int>> cur;
        for (int i = 0; i < n; ++i) cur.insert({d[i], i});
        while (cur.size()) {
            int v = (*cur.begin()).second;
            cur.erase(cur.begin());
            for (auto e : gr[v]) {
                int u = e.first.first, w = e.first.second, ind = e.second;
                if (w == -1) continue;
                if (d[u] > d[v] + w) {
                    cur.erase({d[u], u});
                    d[u] = d[v] + w;
                    cur.insert({d[u], u});
                    p[u] = v;
                    indp[u] = ind;
                }
            }
        }
        vector<int> path(1, t[i]);
        while (path.back() != 0) {
            path.push_back(p[path.back()]);
        }
        reverse(path.begin(), path.end());
        answer(path);
    }
}
}

Details

/usr/bin/ld: /tmp/ccLihsiy.o: in function `main':
stub_Aoi.cpp:(.text.startup+0x328): undefined reference to `aoi[abi:cxx11](int, int, int, int, std::vector<int, std::allocator<int> >, std::vector<int, std::allocator<int> >, std::vector<long long, std::allocator<long long> >, std::vector<int, std::allocator<int> >, std::vector<int, std::allocator<int> >)'
collect2: error: ld returned 1 exit status