# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1085256 | Izzy | Bosses (BOI16_bosses) | C++14 | 0 ms | 348 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 <vector>
#include <algorithm>
#include <iostream>
#include <map>
using namespace std;
int n;
map<int, vector<int>> arr;
int test(int start) {
vector<bool> visited(n, false);
vector<vector<int>> levels = {{start}};
int lvl = 0;
int pos = 0;
int salary = 0;
visited[start] = true;
while (lvl < int(levels.size())) {
start = levels[lvl][pos];
auto it = arr.find(start);
if (it != arr.end()) {
for (int i: arr[start]) {
if (!visited[i]) {
visited[i] = true;
if (int(levels.size()) > lvl + 1) {
levels[lvl + 1].push_back(i);
}
else {
levels.push_back({i});
}
}
}
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |