답안 #613144

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
613144 2022-07-30T03:38:25 Z penguinhacker King of Chairs (FXCUP4_chairs) C++17
컴파일 오류
0 ms 0 KB
#include "king.h"
#include <bits/stdc++.h>
using namespace std;

long long SendInfo(vector<int> w, vector<int> c) {
	/*int n=w.size();
	sort(w.begin(), w.end());
	int lb=0, rb=n;
	while(lb<rb) {
		int mid=(lb+rb+1)/2;
		bool ok=1;
		for (int i=0; i<mid; ++i)
			ok&=w[i]<=c[n-mid+i];
		if (ok)
			lb=mid;
		else
			rb=mid-1;
	}
	return lb;*/
	return 0;
}
#include "vassal.h"
#include <bits/stdc++.h>
using namespace std;

//long long B;

set<ar<int, 2>> st;

void Init(long long _B, vector<int> C) {
	for (int i=0; i<C.size(); ++i)
		st.insert({C[i], i+1});
}

int Maid(int W) {
	auto it=st.lower_bound({W});
	if (it==st.end())
		return -1;
	int x=(*it)[1];
	st.erase(it);
	return x;
}

Compilation message

vassal.cpp:7:5: error: 'ar' was not declared in this scope
    7 | set<ar<int, 2>> st;
      |     ^~
vassal.cpp:7:14: error: template argument 1 is invalid
    7 | set<ar<int, 2>> st;
      |              ^~
vassal.cpp:7:14: error: template argument 2 is invalid
vassal.cpp:7:14: error: template argument 3 is invalid
vassal.cpp: In function 'void Init(long long int, std::vector<int>)':
vassal.cpp:10:17: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   10 |  for (int i=0; i<C.size(); ++i)
      |                ~^~~~~~~~~
vassal.cpp:11:6: error: request for member 'insert' in 'st', which is of non-class type 'int'
   11 |   st.insert({C[i], i+1});
      |      ^~~~~~
vassal.cpp: In function 'int Maid(int)':
vassal.cpp:15:13: error: request for member 'lower_bound' in 'st', which is of non-class type 'int'
   15 |  auto it=st.lower_bound({W});
      |             ^~~~~~~~~~~
vassal.cpp:16:13: error: request for member 'end' in 'st', which is of non-class type 'int'
   16 |  if (it==st.end())
      |             ^~~
vassal.cpp:19:5: error: request for member 'erase' in 'st', which is of non-class type 'int'
   19 |  st.erase(it);
      |     ^~~~~