Submission #1170895

#TimeUsernameProblemLanguageResultExecution timeMemory
1170895mkolko21Meetings (JOI19_meetings)C++20
Compilation error
0 ms0 KiB
#include <iostream> #include <vector> #include meetings.h using namespace std; vector<pair<int,int> > fun(int n, vector<int> tab) { if(tab.size()==0) return {}; vector<vector<int> > pod; vector<int> pom, zap; vector<pair<int,int> > odp, pom2; int i=0; while(tab.size()>0) { pod.push_back({}); pod[i].push_back(tab[0]); for(int a=1; a<tab.size(); a++){ if(Query(n,tab[0],tab[a])==n) pom.push_back(tab[a]); else pod[i].push_back(tab[a]); } tab=pom; pom.clear(); i++; } int p; for(int a=0; a<pod.size(); a++) { p=pod[a][0]; for(int i=1; i<pod[a].size(); i++) if(p!=pod[a][i]) p=Query(n,p,pod[a][i]); odp.push_back({n,p}); zap.push_back(p); } for(int a=0; a<zap.size(); a++) { for(int i=0; i<pod[a].size(); i++) if(pod[a][i]!=zap[a]) pom.push_back(pod[a][i]); pom2=fun(zap[a],pom); for(int i=0; i<pom2.size(); i++) odp.push_back(pom2[i]); pom.clear();pom2.clear(); } return odp; } void Solve(int n) { vector<pair<int,int> > ret; vector<int> p; for(int a=2; a<=n; a++) p.push_back(a); ret=fun(1,p); for(int a=0; a<ret.size(); a++) Bridge(ret[a].first,ret[a].second); }

Compilation message (stderr)

meetings.cpp:3:10: error: #include expects "FILENAME" or <FILENAME>
    3 | #include meetings.h
      |          ^~~~~~~~
meetings.cpp: In function 'std::vector<std::pair<int, int> > fun(int, std::vector<int>)':
meetings.cpp:20:16: error: 'Query' was not declared in this scope
   20 |             if(Query(n,tab[0],tab[a])==n)
      |                ^~~~~
meetings.cpp:36:19: error: 'Query' was not declared in this scope
   36 |                 p=Query(n,p,pod[a][i]);
      |                   ^~~~~
meetings.cpp: In function 'void Solve(int)':
meetings.cpp:62:9: error: 'Bridge' was not declared in this scope
   62 |         Bridge(ret[a].first,ret[a].second);
      |         ^~~~~~