Submission #436487

#TimeUsernameProblemLanguageResultExecution timeMemory
436487PiejanVDCKeys (IOI21_keys)C++17
Compilation error
0 ms0 KiB
#include "candies.h"
#include <bits/stdc++.h>
using namespace std;

vector<int> find_reachable(vector<int> r, vector<int> u, vector<int> v, vector<int> c) {
    int n = r.size();
    vector<int>adj[n];
    for(int i = 0 ; i < n ; i++) {
        adj[u[i]].push_back(v[i]);
        adj[v[i]].push_back(u[i]);
    }
    vector<int>ans(n);
    for(int i = 0 ; i < n ; i++) {
        if(r[i] == 0) {
            stack<int>s;
            s.push(i);
            int cnt=-1;
            vector<bool>vis(n,false);
            while(!s.empty()) {
                cnt++;
                int node = s.top();
                vis[node]=true;
                s.pop();
                for(auto z : adj[node]) {
                    if(!vis[z]) s.push(z);
                }
            }
            ans[i]=cnt;
        } else ans[i]=0;
    }
    return ans;
}

Compilation message (stderr)

keys.cpp:1:10: fatal error: candies.h: No such file or directory
    1 | #include "candies.h"
      |          ^~~~~~~~~~~
compilation terminated.