Submission #210461

# Submission time Handle Problem Language Result Execution time Memory
210461 2020-03-17T12:20:26 Z mhy908 Meetings (JOI19_meetings) C++14
Compilation error
0 ms 0 KB
//#include "meetings.h"
#include <bits/stdc++.h>
#define pb push_back
#define all(x) x.begin(), x.end()
using namespace std;
int base;
bool comp(int a, int b){return Query(base, a, b)==a;}
unordered_map<int, vector<int> > ump;
void solve(vector<int> vc){
	if(vc.size()<=1)return;
	ump[vc[0]].pb(vc[0]);
	ump[vc[1]].pb(vc[1]);
	vector<int> path;
	for(int i=2; i<vc.size(); i++){
		int x=Query(vc[0], vc[1], vc[i]);
		if(ump[x].empty())path.pb(x);
		ump[x].pb(vc[i]);
	}
	base=vc[0];
	sort(all(path), comp);
	for(int i=0; i<path.size()-1; i++)Bridge(min(path[i], path[i+1]), max(path[i], path[i+1]));
	for(int i=0; i<path.size(); i++){
		vector<int> temp=ump[path[i]];
		ump[path[i]].clear();
		solve(temp);
	}
}
void Solve(int n){
	vector<int> temp;
	for(int i=0; i<n; i++)temp.pb(i);
	solve(i);
}

Compilation message

meetings.cpp: In function 'bool comp(int, int)':
meetings.cpp:7:32: error: 'Query' was not declared in this scope
 bool comp(int a, int b){return Query(base, a, b)==a;}
                                ^~~~~
meetings.cpp: In function 'void solve(std::vector<int>)':
meetings.cpp:14:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for(int i=2; i<vc.size(); i++){
               ~^~~~~~~~~~
meetings.cpp:15:9: error: 'Query' was not declared in this scope
   int x=Query(vc[0], vc[1], vc[i]);
         ^~~~~
meetings.cpp:21:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for(int i=0; i<path.size()-1; i++)Bridge(min(path[i], path[i+1]), max(path[i], path[i+1]));
               ~^~~~~~~~~~~~~~
meetings.cpp:21:36: error: 'Bridge' was not declared in this scope
  for(int i=0; i<path.size()-1; i++)Bridge(min(path[i], path[i+1]), max(path[i], path[i+1]));
                                    ^~~~~~
meetings.cpp:21:36: note: suggested alternative: 'fwide'
  for(int i=0; i<path.size()-1; i++)Bridge(min(path[i], path[i+1]), max(path[i], path[i+1]));
                                    ^~~~~~
                                    fwide
meetings.cpp:22:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for(int i=0; i<path.size(); i++){
               ~^~~~~~~~~~~~
meetings.cpp: In function 'void Solve(int)':
meetings.cpp:31:8: error: 'i' was not declared in this scope
  solve(i);
        ^