Submission #294381

#TimeUsernameProblemLanguageResultExecution timeMemory
294381eohomegrownappsTowns (IOI15_towns)C++14
Compilation error
0 ms0 KiB
#include "train.h" #include <bits/stdc++.h> using namespace std; int n,m; vector<vector<int>> adjlist; vector<vector<int>> revadjlist; vector<int> aowns; vector<int> charging; vector<int> used; // 0 - eliminated, 1 - unvisited, 2 - in f vector<int> awins; void genSet(){ vector<int> numconnected(n,0); queue<int> q; for (int i = 0; i<n; i++){ if (used[i]==2){ q.push(i); } } while (q.size()>0){ int f = q.front(); q.pop(); for (int i : revadjlist[f]){ if (used[i]!=1){continue;} numconnected[i]++; if (aowns[i]||((!aowns[i])&&numconnected[i]==adjlist[i].size())){ // i is in s used[i]=2; q.push(i); } } } } bool eliminate(){ for (int i = 0; i<n; i++){ if (used[i]!=0){ used[i]=1; } if (charging[i]){ used[i]=2; } } genSet(); bool ahasall = true; for (int i = 0; i<n; i++){ if (used[i]==1){ used[i]=2; ahasall=false; } else if (used[i]==2){ used[i]=1; } } if (ahasall){ for (int i = 0; i<n; i++){ if (used[i]==1){ awins[i]=1; } } return true; } genSet(); for (int i = 0; i<n; i++){ if (used[i]==2){ awins[i]=0; used[i]=0; } } return false; } std::vector<int> who_wins(std::vector<int> _aowns, std::vector<int> _charging, std::vector<int> u, std::vector<int> v) { aowns=_aowns; charging=_charging; n=aowns.size(); m=u.size(); //cout<<"blah"<<endl; //cout<<n<<endl; adjlist.resize(n); revadjlist.resize(n); for (int i = 0; i<m; i++){ //cout<<u[i]<<' '<<v[i]<<endl; adjlist[u[i]].push_back(v[i]); revadjlist[v[i]].push_back(u[i]); } //cout<<"bleh"<<endl; awins.resize(n); used.resize(n,1); while (!eliminate()){ continue; } return awins; }

Compilation message (stderr)

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