답안 #232054

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
232054 2020-05-15T20:35:43 Z Blerargh King of Chairs (FXCUP4_chairs) C++17
컴파일 오류
0 ms 0 KB
#include "king.h"
#include <vector>
long long SendInfo(std::vector<int> W, std::vector<int> C) return 0;
#include <bits/stdc++.h>
#include "vassal.h"
using namespace std;
 
typedef pair<int, int> ii;
set<ii> chairs;
 
void Init(long long B, vector<int> C){
  int n = C.size();
  for (int i=0; i<n; i++){
    chairs.insert(make_pair(C[i],i));
  }
}
 
int Maid(int w){
  auto it = chairs.lower_bound(make_pair(w,0));
  if (it == chairs.end()) return -1;
  else {
    int ans = (*it).second;
    chairs.erase(it);
    return ans;
  }
}

Compilation message

king.cpp: In function 'long long int SendInfo(std::vector<int>, std::vector<int>)':
king.cpp:3:67: error: expected identifier before numeric constant
 long long SendInfo(std::vector<int> W, std::vector<int> C) return 0;
                                                                   ^
king.cpp:3:60: error: named return values are no longer supported
 long long SendInfo(std::vector<int> W, std::vector<int> C) return 0;
                                                            ^~~~~~
king.cpp:3:68: error: expected '{' at end of input
 long long SendInfo(std::vector<int> W, std::vector<int> C) return 0;
                                                                    ^
king.cpp:3:68: warning: no return statement in function returning non-void [-Wreturn-type]