QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#884416#111. Amusement Park_8_8_Compile Error//C++233.6kb2025-02-06 05:15:462025-02-06 05:15:46

Judging History

This is the latest submission verdict.

  • [2025-02-06 05:15:46]
  • Judged
  • [2025-02-06 05:15:46]
  • Submitted

Joi

#include "Joi.h"
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

const int N = (int)1e5 + 12, b = 60;

mt19937 rng1(123321);
vector<int> g1[N], G1[N];
int tin1[N], timer1;
bool vis1[N];
ll x;

void bfs1(int v) {
    queue<int> q;
    q.push(v);
    vis1[v] = 1;
    while(!q.empty()) {
        int v = q.front();
        q.pop();
        for(int to : g1[v]) {
            if(!vis1[to]) {
                q.push(to);
                G1[v].push_back(to);
                vis1[to] = 1;
            }
        }
    }
}
void dfs1(int v) {
    tin1[v] = timer1++;
    vis1[v] = 1;
    MessageBoard(v, ((x >> (tin1[v] % 60)) & 1));
    for(int to : G1[v]) {
        if(!vis1[to]) {
            dfs1(to);
        }        
    }
}
void Joi(int n, int m, int A[], int B[], long long X, int T) {
    x = X;
    for(int i = 0; i < m; i++) {
        g1[A[i]].push_back(B[i]);
        g1[B[i]].push_back(A[i]);
    }
    for(int i = 0; i < n; i++) {
        sort(g1[i].begin(), g1[i].end());
    }
    bfs1(0);
    for(int i = 0; i < n; i++) {
        vis1[i] = 0;
    }
    dfs1(0);
}

Ioi

#include "Ioi.h"
#include <bits/stdc++.h>

using namespace std;
typedef long long ll;

const int N = (int)1e5 + 12, b = 60;

mt19937 rng(123321);
ll d[N], mxd[N], pr[N], timer, sz[N];
vector<int> g[N], G[N];
int tin[N], bt[N], tout[N];
bool vis[N];

void bfs(int v) {
    queue<int> q;
    q.push(v);
    vis[v] = 1;
    while(!q.empty()) {
        int v = q.front();
        q.pop();
        for(int to : g[v]) {
            if(!vis[to]) {
                G[v].push_back(to);
                q.push(to);
                vis[to] = 1;
            }
        }
    }
}
void dfs(int v) {
    tin[v] = timer++;
    tin[v] %= b;
    vis[v] = 1;
    sz[v] = 1;
    for(int to : G[v]) {
        if(!vis[to]) {
            pr[to] = v;
            dfs(to);
            sz[v] += sz[to];
        }        
    }
    tout[v] = timer;
    tout[v] %= b;
}

ll ans = 0;
bool check() {
    bool ret = true;
    for(int i = 0; i < b; i++) {
        if(bt[i] == -1) ret = false;
    }
    return ret;
}
bool ok = 1;
void go(int v, int val) {
    bt[tin[v]] = val;
    vis[v] = 1;
    if(check()) {
        return;
    }
    for(int to : G[v]) {
        if(!vis[to]) {
            bool ok = 1;
            for(int j = min(tin[to], tout[to]); j <= max(tin[to], tout[to]); j++) {
                if(bt[j] == -1) {
                    ok = 0;
                }
            }
            if(ok) continue;
            go(to, Move(to));
            if(check()) return;
        }
    }
    go(pr[v], Move(pr[v]));
    vector<int> nv;
    bool ok = 0;
    for(int to : G[pr[v]]) {
        if(to == v) {
            ok = 1;
        } else {
            if(ok) {
                nv.push_back(to);
            }
        }
    }
    for(int to : G[pr[v]]) {
        if(to == v) break;
        nv.push_back(to);
    }
    G[pr[v]] = nv;
}
long long Ioi(int n, int m, int A[], int B[], int P, int V, int T) {
    for(int i = 0; i < m; i++) {
        g[A[i]].push_back(B[i]);
        g[B[i]].push_back(A[i]);
    }
    for(int i = 0; i < n; i++) {
        sort(g[i].begin(), g[i].end());
    }
    bfs(0);
    for(int i = 0; i < n; i++) vis[i] = 0;
    dfs(0);
    for(int i = 0; i < b; ++i) {
        bt[i] = -1;
    }
    for(int i = 0; i < n; i++) {
        vis[i] = 0;
    }
    go(P, V);
    for(int i = 0; i < b; i++) {
        if(bt[i]) {
            ans += (1ll << i);
        }
    }
    return ans;
}

Details

Joi.code:10:1: error: ‘mt19937’ does not name a type
   10 | mt19937 rng1(123321);
      | ^~~~~~~
Joi.code: In function ‘void bfs1(int)’:
Joi.code:23:22: warning: range-based ‘for’ loops only available with ‘-std=c++11’ or ‘-std=gnu++11’
   23 |         for(int to : g1[v]) {
      |                      ^~
Joi.code:23:26: error: forming reference to reference type ‘std::vector<int>&’
   23 |         for(int to : g1[v]) {
      |                          ^
Joi.code: In function ‘void dfs1(int)’:
Joi.code:36:18: warning: range-based ‘for’ loops only available with ‘-std=c++11’ or ‘-std=gnu++11’
   36 |     for(int to : G1[v]) {
      |                  ^~
Joi.code:36:22: error: forming reference to reference type ‘std::vector<int>&’
   36 |     for(int to : G1[v]) {
      |                      ^
In file included from grader_Joi.cpp:2:
testlib.h: In member function ‘std::vector<T> random_t::distinct(int, T, T)’:
testlib.h:997:9: error: ‘uint64_t’ was not declared in this scope; did you mean ‘u_int64_t’?
  997 |         uint64_t n = to - from + 1;
      |         ^~~~~~~~
      |         u_int64_t
testlib.h:998:30: error: ‘n’ was not declared in this scope
  998 |         if (uint64_t(size) > n)
      |                              ^
testlib.h:1007:32: error: ‘n’ was not declared in this scope
 1007 |             expected += double(n) / double(n - i + 1);
      |                                ^
testlib.h:1009:31: error: ‘n’ was not declared in this scope
 1009 |         if (expected < double(n)) {
      |                               ^
grader_Joi.cpp: In function ‘int {anonymous}::Move(int)’:
grader_Joi.cpp:30:19: warning: extended initializer lists only available with ‘-std=c++11’ or ‘-std=gnu++11’
   30 |  if (!edges.count({ pos, dest })) {
      |                   ^
grader_Joi.cpp:30:32: warning: extended initializer lists only available with ‘-std=c++11’ or ‘-std=gnu++11’
   30 |  if (!edges.count({ pos, dest })) {
      |                                ^
grader_Joi.cpp: In function ‘int main(int, char**)’:
grader_Joi.cpp:57:12: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
   57 |  char *t = "/dev/null";
      |            ^~~~~~~~~~~
grader_Joi.cpp:71:16: warning: extended initializer lists only available with ‘-std=c++11’ or ‘-std=gnu++11’
   71 |   edges.insert({ A[i], B[i] });
      |                ^
grader_Joi.cpp:71:30: warning: extended initializer lists only available with ‘-std=c++11’ or ‘-std=gnu++11’
   71 |   edges.insert({ A[i], B[i] });
      |                              ^
grader_Joi.cpp:72:16: warning: extended initializer lists only available with ‘-std=c++11’ or ‘-std=gnu++11’
   72 |   edges.insert({ B[i], A[i] });
      |                ^
grader_Joi.cpp:72:30: warning: extended initializer lists only available with ‘-std=c++11’ or ‘-std=gnu++11’
   72 |   edges.insert({ B[i], A[i] });
      |                              ^