제출 #792119

#제출 시각아이디문제언어결과실행 시간메모리
792119PoonYaPatTriangles (CEOI18_tri)C++14
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; int n; vector<int> up,down; deque<int> dq; bool comp(int a, int b) {return is_clockwise(1,a,b);} void add(int x) { while (dq.size()>=2 && !is_clockwise(dq[dq.size()-2],dq[dq.size()-1],x)) dq.pop_back(); dq.push_back(x); } int main() { ios_base::sync_with_stdio(0); cin.tie(0); n=get_n(); for (int i=3; i<=n; ++i) { if (is_clockwise(1,2,i)) down.push_back(i); else up.push_back(i); } sort(up.begin(),up.end(),comp); sort(down.begin(),down.end(),comp); add(1); for (auto s : up) add(s); add(2); for (auto s : down) add(s); int cnt=dq.size(); while (cnt--) { add(dq.front()); dq.pop_front(); } give_answer(dq.size()); }

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

tri.cpp: In function 'bool comp(int, int)':
tri.cpp:8:33: error: 'is_clockwise' was not declared in this scope
    8 | bool comp(int a, int b) {return is_clockwise(1,a,b);}
      |                                 ^~~~~~~~~~~~
tri.cpp: In function 'void add(int)':
tri.cpp:11:29: error: 'is_clockwise' was not declared in this scope
   11 |     while (dq.size()>=2 && !is_clockwise(dq[dq.size()-2],dq[dq.size()-1],x)) dq.pop_back();
      |                             ^~~~~~~~~~~~
tri.cpp: In function 'int main()':
tri.cpp:17:7: error: 'get_n' was not declared in this scope
   17 |     n=get_n();
      |       ^~~~~
tri.cpp:19:13: error: 'is_clockwise' was not declared in this scope
   19 |         if (is_clockwise(1,2,i)) down.push_back(i);
      |             ^~~~~~~~~~~~
tri.cpp:34:5: error: 'give_answer' was not declared in this scope
   34 |     give_answer(dq.size());
      |     ^~~~~~~~~~~