Submission #153173

# Submission time Handle Problem Language Result Execution time Memory
153173 2019-09-12T17:03:33 Z phpark King of Chairs (FXCUP4_chairs) C++17
Compilation error
0 ms 0 KB
#include "king.h"
long long SendInfo(vector <int> W, vector <int> C)
{
	return 1;
}
#include <set>
#include <vector>
#include <algorithm>
#include "vassal.h"
using namespace std;
set <int> sit;
int N;
extern vector <int> C;
void Init(long long B, vector <int> C)
{
	
    sort(C.begin(), C.end());
    N = C.size();
	for (int i = 0; i < N; i++) sit.insert(i);
}
 
int Maid(int w)
{
	int right = 0, left = 0, mid = 0, res = 0;
	while (right <= left) {
		mid = (right + left) / 2;
		if (C[mid] > w) {
			right = mid - 1;
			if (right <= left) {
				res = mid;
				break;
			}
		}
		else if (C[mid] < w) {
			left = mid + 1;
			if (right <= left) {
				res = right;
				break;
			}
		}
		else {
			res = mid;
			break;
		}
	}
	
	auto itr = sit.upper_bound(res);
	if (itr == sit.end()) {
		return -1;
	}
	else {
		int answer = *itr;
		sit.erase(itr);
			
		return answer;
	}
}

Compilation message

king.cpp:2:20: error: 'long long int SendInfo' redeclared as different kind of symbol
 long long SendInfo(vector <int> W, vector <int> C)
                    ^~~~~~
In file included from king.cpp:1:0:
king.h:3:11: note: previous declaration 'long long int SendInfo(std::vector<int>, std::vector<int>)'
 long long SendInfo(std::vector<int> W, std::vector<int> C);
           ^~~~~~~~
king.cpp:2:20: error: 'vector' was not declared in this scope
 long long SendInfo(vector <int> W, vector <int> C)
                    ^~~~~~
king.cpp:2:20: note: suggested alternative:
In file included from /usr/include/c++/7/vector:64:0,
                 from king.h:2,
                 from king.cpp:1:
/usr/include/c++/7/bits/stl_vector.h:216:11: note:   'std::vector'
     class vector : protected _Vector_base<_Tp, _Alloc>
           ^~~~~~
king.cpp:2:28: error: expected primary-expression before 'int'
 long long SendInfo(vector <int> W, vector <int> C)
                            ^~~
king.cpp:2:36: error: 'vector' was not declared in this scope
 long long SendInfo(vector <int> W, vector <int> C)
                                    ^~~~~~
king.cpp:2:36: note: suggested alternative:
In file included from /usr/include/c++/7/vector:64:0,
                 from king.h:2,
                 from king.cpp:1:
/usr/include/c++/7/bits/stl_vector.h:216:11: note:   'std::vector'
     class vector : protected _Vector_base<_Tp, _Alloc>
           ^~~~~~
king.cpp:2:44: error: expected primary-expression before 'int'
 long long SendInfo(vector <int> W, vector <int> C)
                                            ^~~