# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
874232 | tvladm2009 | Long Mansion (JOI17_long_mansion) | C++17 | 643 ms | 66560 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using i64 = long long;
int main() {
std::ios::sync_with_stdio(false);
std::cin.tie(nullptr);
int n;
std::cin >> n;
std::vector<int> a(n);
std::vector<std::vector<int>> keys(n + 1), inds(n + 1);
for (int i = 1; i < n; i++) {
std::cin >> a[i];
}
for (int i = 1; i <= n; i++) {
int m;
std::cin >> m;
keys[i].resize(m);
for (int j = 0; j < m; j++) {
std::cin >> keys[i][j];
inds[keys[i][j]].push_back(i);
}
}
auto check = [&](int l, int r, int x) {
auto it = lower_bound(inds[x].begin(), inds[x].end(), l);
return it != inds[x].end() && *it <= r;
};
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |