QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#875474 | #8726. Magic Show | billf | Compile Error | / | / | C++20 | 1.9kb | 2025-01-29 20:37:27 | 2025-01-29 20:37:36 |
Judging History
This is the latest submission verdict.
- [2025-01-29 20:37:36]
- Judged
- Verdict: Compile Error
- Time: 0ms
- Memory: 0kb
- [2025-01-29 20:37:27]
- 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);
n = 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:5: error: ‘n’ was not declared in this scope 14 | n = 5000; | ^