QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#521051 | #8726. Magic Show | Misty7 | Compile Error | / | / | C++14 | 804b | 2024-08-15 20:29:35 | 2024-08-15 20:29:36 |
Judging History
Alice
#include <bits/stdc++.h>
#include "Alice.h"
using i64 = long long;
constexpr int N = 5000;
std::vector<std::pair<int, int>> Alice () {
i64 n = setN(N);
std::vector<std::pair<int, int>> edges;
for (int i = 1; i < n; i++) {
edges.emplace_back(n % i + 1, i + 1);
}
return edges;
}
Bob
#include <bits/stdc++.h>
#include "Bob.h"
using i64 = long long;
constexpr i64 limit = 1E15;
i64 lcm (i64 a, i64 b) {
return a / std::__gcd(a, b) * b;
}
i64 Bob (std::vector<std::pair<int, int>> edges) {
i64 ans = 0, per = 0;
for (auto [x, y] : edges) {
x--, y--;
while (ans % x != y) {
ans += per;
}
per = lcm(per, y);
if (per >= lim) {
break;
}
}
return ans;
}
详细
Bob.code: In function ‘i64 Bob(std::vector<std::pair<int, int> >)’: Bob.code:20:20: error: ‘lim’ was not declared in this scope; did you mean ‘lcm’? 20 | if (per >= lim) { | ^~~ | lcm