QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#121924#1148. GameQwerty1232#Compile Error//C++17990b2023-07-09 00:39:382024-07-04 00:32:47

Judging History

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

  • [2024-07-04 00:32:47]
  • 评测
  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-07-09 00:39:38]
  • 提交

answer

#pragma GCC target("avx512vl,avx512bl,avx512bitalg,avx512dq")
#pragma GCC optimize("O3")
#include "game.h"

#include <bits/stdc++.h>

constexpr int N = 1501;
// std::vector<std::vector<int>> gr;
std::array<std::bitset<N>, N> gr;
int n;

void initialize(int n) {
    // while (clock() * 1.0 / CLOCKS_PER_SEC < 0.95) {
    //     ;
    // }
    // exit(0);
    ::n = n;
    for (int i = 0; i < n; i++) {
        gr[i].reset();
        gr[i] = ~gr[i];
        gr[i][i] = 0;
    }
}

int hasEdge(int u, int v) {
    gr[u][v] = gr[v][u] = 0;

    std::bitset<N> used;
    used.reset();
    used = ~used;
    auto dfs = [&](auto dfs, int v) -> void {
        int t = (used & gr[v])._Find_first();
        used[v] = 0;
        while (t < n) {
            dfs(dfs, t);
            t = (used & gr[v])._Find_next(t);
        }
    };
    dfs(dfs, 0);
    if (used._Find_first() == n) {
        return 0;
    }
    gr[u][v] = gr[v][u] = 1;
    return 1;
}

Details

cc1plus: error: attribute ‘target’ argument ‘avx512bl’ is unknown