# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
470917 | Tentacleslave | Keys (IOI21_keys) | C++17 | 1 ms | 460 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 <cstdio>
#include <vector>
#include <deque>
#include <algorithm>
#include <set>
using namespace std;
int increment = 0;
vector<vector<int>> room_group_keys;// --- room group ... data: keys assigned to room group, ordered by key
vector<vector<int>> room_group_rooms;
vector<vector<pair<int, int>>> connector;// --- connector ... data: (outbound room group, key)
vector<int> stack;
vector<int> mutex, depth;
void dfs_init() {
stack.clear();
increment = 0;
mutex.resize(room_group_keys.size());
for(auto& i : mutex) i = 0;
depth.resize(room_group_keys.size());
for(auto& i : depth) i = 0;
}
void dfs(int x) {
if(mutex[x] == 1) return;
mutex[x] = 1;
for(auto i : connector[x]) {
if(binary_search(room_group_keys[x].begin(), room_group_keys[x].end(), i.second))
dfs(i.first);
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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |