답안 #150085

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
150085 2019-09-01T07:41:43 Z HSNU(#3687, joylintp, 147, wiwiho) King of Chairs (FXCUP4_chairs) C++17
컴파일 오류
0 ms 0 KB
#include "king.h"

#include <bits/stdc++.h>
/*
#define StarBurstStream ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define iter(a) a.begin(), a.end()
#define riter(a) a.rbegin(), a.rend()
#define lsort(a) sort(iter(a))
#define gsort(a) sort(riter(a))
#define mp(a, b) make_pair(a, b)
#define pb(a) push_back(a)
#define pf(a) push_front(a)
#define pob pop_back()
#define pof pop_front()
#define F first
#define S second
#define printv(a, b) {bool pvaspace=false; \
for(auto pva : a){ \
    if(pvaspace) b << " "; pvaspace=true;\
    b << pva;\
}\
b << "\n";}
#define pii pair<int, int>
#define pll pair<ll, ll>
#define modadd(a, b) (((a % MOD) + (b % MOD)) % MOD)
#define modtimes(a, b) (((a % MOD) * (b % MOD)) % MOD)

//#define TEST

typedef long long ll;
typedef unsigned long long ull;
*/
using namespace std;
/*
const ll MOD = 1000000007;
const ll MAX = 2147483647;
*/
long long SendInfo(std::vector<int> W, std::vector<int> C) {
	lsort(W);
	lsort(C);

	int wp = 0, cp = 0;
	int ans = 0;
	int n = W.size();
	while(wp < n && cp < n){
		if(W[wp] < C[cp]){
			ans++;
			wp++;
		}
		cp++;
	}

	return ans;
}
#include "vassal.h"

#include <bits/stdc++.h>

#define StarBurstStream ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define iter(a) a.begin(), a.end()
#define riter(a) a.rbegin(), a.rend()
#define lsort(a) sort(iter(a))
#define gsort(a) sort(riter(a))
#define mp(a, b) make_pair(a, b)
#define pb(a) push_back(a)
#define pf(a) push_front(a)
#define pob pop_back()
#define pof pop_front()
#define F first
#define S second
#define printv(a, b) {bool pvaspace=false; \
for(auto pva : a){ \
    if(pvaspace) b << " "; pvaspace=true;\
    b << pva;\
}\
b << "\n";}
#define pii pair<int, int>
#define pll pair<ll, ll>
#define modadd(a, b) (((a % MOD) + (b % MOD)) % MOD)
#define modtimes(a, b) (((a % MOD) * (b % MOD)) % MOD)

//#define TEST

typedef long long ll;
typedef unsigned long long ull;

using namespace std;

const ll MOD = 1000000007;
const ll MAX = 2147483647;

long long BB;
std::vector<int> c;
int n;
vector<bool> b;
void Init(long long B, std::vector<int> C){
	BB = B;
	c = C;
	n = c.size();
	b.resize(n);
}

int Maid(int W){
	int s = upper_bound(iter(c), W) - c.begin();
	for(; s < n; s++){
		if(b[s]) continue;
		b[s] = true;
		return s;
	}
	return -1;
}

Compilation message

king.cpp: In function 'long long int SendInfo(std::vector<int>, std::vector<int>)':
king.cpp:39:2: error: 'lsort' was not declared in this scope
  lsort(W);
  ^~~~~
king.cpp:39:2: note: suggested alternative: 'qsort'
  lsort(W);
  ^~~~~
  qsort