QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#34678#4251. Gamelunchbox#Compile Error//C++17773b2022-06-12 04:38:152024-05-26 00:51:54

Judging History

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

  • [2024-05-26 00:51:54]
  • 评测
  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2022-06-12 04:38:15]
  • 提交

answer

#pragma GCC optimize ("Ofast")
#pragma GCC target ("avx2")

#include "game.h"
#include <bits/stdc++.h>
using namespace std;

const int N = 30000;

std::vector<int> ej[N];
int ww[N], tt[N], n;

void init(int n_, int k) {
  n = n_;
  for (int i = 0; i < n; i++)
    ej[i].clear(), ww[i] = 0;
  for (int i = 0; i < k - 1; i++)
    ej[i].push_back(i + 1), ww[i + 1]++;
}

int add_teleporter(int u, int v) {
  std::vector<int> qu;

  ej[u].push_back(v), ww[v]++;

  qu.reserve(n);
  for (int i = 0; i < n; i++)
    if ((tt[i] = ww[i]) == 0)
      qu.push_back(i);

  for (int q = 0; q < (int) qu.size(); q++) {
    int i = qu[q];

    for (int j : ej[i])
      if (--tt[j] == 0)
        qu.push_back(j);
  }
  return (int) qu.size() != n;
}

详细

In file included from /usr/include/c++/13/string:43,
                 from /usr/include/c++/13/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/13/bits/stdc++.h:52,
                 from answer.code:5:
/usr/include/c++/13/bits/allocator.h: In destructor ‘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’ ‘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,
                 from /usr/include/c++/13/functional:64,
                 from /usr/include/x86_64-linux-gnu/c++/13/bits/stdc++.h:53:
/usr/include/c++/13/bits/stl_vector.h:133:14: note: called from here
  133 |       struct _Vector_impl
      |              ^~~~~~~~~~~~