QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#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;
}
Details
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