# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
441877 | Stickfish | Keys (IOI21_keys) | C++17 | 3070 ms | 30088 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 <bitset>
using namespace std;
const int MAXN = 3e5 + 123;
vector<pair<int, int>> edg[MAXN];
int keyget[MAXN];
bitset<MAXN> used;
vector<int> solve_quad(int n){
vector<int> ans(n);
bitset<MAXN> used_cl;
vector<vector<int>> reachable(n);
for(int i = 0; i < n; ++i){
used.reset();
used_cl.reset();
for(int j = 0; j < n; ++j){
reachable[j].clear();
}
vector<int> stck = {i};
while(stck.size()){
int v = stck.back();
stck.pop_back();
if(used[v])
continue;
used[v] = used_cl[keyget[v]] = 1;
for(auto u : reachable[keyget[v]]){
stck.push_back(u);
}
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... |