QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#139497#2674. Vision programQwerty1232#Compile Error//C++201.6kb2023-08-13 18:30:472024-07-04 01:41:14

Judging History

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

  • [2024-07-04 01:41:14]
  • 评测
  • [2023-08-13 18:30:47]
  • 提交

answer

#pragma GCC optimize("O3")
#pragma GCC target("avx2")
#include "vision.h"

#include <bits/stdc++.h>

void construct_network(int n, int m, int k) {
    auto get = [&](int i, int j) {
        return i * m + j;
    };
    if (n * m == 2) {
        add_or({0, 1});
        return;
    }
    int zero = add_and({0, 1, 2});
    int one = add_not(zero);

    std::vector<std::vector<int>> d1(n + m - 1), d2(n + m - 1);
    for (int i = 0; i < n; i++) {
        for (int j = 0; j < m; j++) {
            d1[i + j].push_back(get(i, j));
            d2[i - j + m - 1].push_back(get(i, j));
        }
    }

    auto make_cum = [&](std::vector<std::vector<int>> input) -> std::pair<int, int> {
        int n = input.size();
        std::vector<int> vec(n);
        for (int i = 0; i < n; i++) {
            vec[i] = add_or(input[i]);
        }
        std::vector<int> va;
        for (int i = 0; i + k < n; i++) {
            va.push_back(add_and({vec[i], vec[i + k]}));
        }
        int a = add_or(va);

        std::vector<int> fuck;
        for (int i = 0; i < n; i++) {
            std::vector<int> vc;
            for (int j = 0; j < n; j++) {
                if (abs(i - j) > k) {
                    vc.push_back(vec[j]);
                }
            }
            fuck.push_back(add_and({add_or(vc), vec[i]}));
        }
        int fck = add_or(fuck);
        int not_fuck = add_not(fck);
        return {a, not_fuck};
    };

    auto [a1, b1] = make_cum(d1);
    auto [a2, b2] = make_cum(d2);

    // add_and({a1, a2});
    int p1 = add_and({a1, b2});
    int p2 = add_and({a2, b1});
    add_or({p1, p2});
}

Details

In file included from /usr/include/c++/13/vector:63,
                 from vision.h:1,
                 from answer.code:3:
/usr/include/c++/13/bits/allocator.h: In destructor ‘constexpr std::_Vector_base<int, std::allocator<int> >::_Vector_impl::~_Vector_impl()’:
/usr/include/c++/13/bits/allocator.h:184:7: error: inlining failed in call to ‘always_inline’ ‘constexpr std::allocator< <template-parameter-1-1> >::~allocator() noexcept [with _Tp = int]’: target specific option mismatch
  184 |       ~allocator() _GLIBCXX_NOTHROW { }
      |       ^
In file included from /usr/include/c++/13/vector:66:
/usr/include/c++/13/bits/stl_vector.h:133:14: note: called from here
  133 |       struct _Vector_impl
      |              ^~~~~~~~~~~~