제출 #153139

#제출 시각아이디문제언어결과실행 시간메모리
153139phparkKing of Chairs (FXCUP4_chairs)C++17
컴파일 에러
0 ms0 KiB
#inlcude <iostream> #include "king.h" #include <vector> #include <algorithm> #include <set> using namespace std; int SendInfo(vector <int> W, vector <int> C) { return 1; }
#include <iostream> #include <vector> #include <algorithm> #include <set> #include "vassal.h" using namespace std; set <int> sit; void Init(int B, vector <int> C) { sort(C.begin(), C.end()); 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; } }

컴파일 시 표준 에러 (stderr) 메시지

king.cpp:1:2: error: invalid preprocessing directive #inlcude; did you mean #include?
 #inlcude <iostream>
  ^~~~~~~
  include
king.cpp: In function 'int SendInfo(std::vector<int>, std::vector<int>)':
king.cpp:7:5: error: ambiguating new declaration of 'int SendInfo(std::vector<int>, std::vector<int>)'
 int SendInfo(vector <int> W, vector <int> C)
     ^~~~~~~~
In file included from king.cpp:2:0:
king.h:3:11: note: old declaration 'long long int SendInfo(std::vector<int>, std::vector<int>)'
 long long SendInfo(std::vector<int> W, std::vector<int> C);
           ^~~~~~~~

vassal.cpp: In function 'void Init(int, std::vector<int>)':
vassal.cpp:11:22: error: 'N' was not declared in this scope
  for (int i = 0; i < N; i++) sit.insert(i);
                      ^
vassal.cpp: In function 'int Maid(int)':
vassal.cpp:19:7: error: 'C' was not declared in this scope
   if (C[mid] > w) {
       ^