QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#875477#8726. Magic ShowbillfCompile Error//C++201.9kb2025-01-29 20:38:262025-01-29 20:38:31

Judging History

This is the latest submission verdict.

  • [2025-01-29 20:38:31]
  • Judged
  • [2025-01-29 20:38:26]
  • Submitted

Alice

#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
typedef pair<int, int> PII;
#define fr first
#define sc second
mt19937 rd(time(0));
LL setN(int x);
vector<PII> Alice()
{
    vector<PII> e;
    vector<int> poi[100];
    LL x = setN(5000);
    for (int i = 2; i <= n; i++)
    {
        int id = i % 61;
        if (poi[id].size() <= 1)
            e.push_back({1, i});
        poi[id].push_back(i);
    }
    for (int i = 60; ~i; i--)
    {
        int ln = poi[i].size();
        if (x >> i & 1)
        {
            for (int j = 2; j < ln; j++)
            {
                int num, to;
                num = (j + 1) / 2;
                to = 2 * (rd() % num) + 1;
                e.push_back({poi[i][j - to], poi[i][j]});
            }
        }
        else
        {
            for (int j = 2; j < ln; j++)
            {
                int num, to;
                num = j / 2;
                to = 2 * (rd() % num);
                e.push_back({poi[i][j - to], poi[i][j]});
            }
        }
    }
    return e;
}

Bob

#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
typedef pair<int, int> PII;
mt19937 rd(time(0));
LL Bob(vector<PII> e)
{
    vector<int> poi[100];
    int fth[5005] = {0};
    LL res = 0;
    for (int i = 2; i <= 5000; i++)
    {
        int id = i % 61;
        poi[id].push_back(i);
    }
    for (auto [x, y] : e)
        fth[y] = x;
    for (int i = 60; ~i; i--)
    {
        int ln = poi[i].size();
        for (int j = 2; j < ln; j++)
        {
            int num = fth[poi[i][j]];
            if (!num)
                continue;
            auto it = lower_bound(poi[i].begin(), poi[i].end(), num);
            int dis = j - distance(poi[i].begin(), it);
            if (dis & 1)
                res += 1ll << i;
            break;
        }
    }
    return res;
}

詳細信息

Alice.code: In function ‘std::vector<std::pair<int, int> > Alice()’:
Alice.code:14:26: error: ‘n’ was not declared in this scope
   14 |     for (int i = 2; i <= n; i++)
      |                          ^