QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#806252#8642. Spy 3topfloorboss#Compile Error//C++203.7kb2024-12-09 01:25:172024-12-09 01:25:18

Judging History

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

  • [2024-12-09 01:25:18]
  • 评测
  • [2024-12-09 01:25:17]
  • 提交

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

Aoi.code:68:2: error: expected ‘}’ at end of input
   68 | }
      |  ^
Aoi.code:23:11: note: to match this ‘{’
   23 | namespace {
      |           ^