제출 #1321118

#제출 시각아이디문제언어결과실행 시간메모리
1321118LudisseyTriangles (CEOI18_tri)C++20
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> #include "trilib.h" #define int long long #define sz(a) (int)a.size() #define all(a) a.begin(), a.end() #define rall(a) a.rbegin(), a.rend() using namespace std; signed main() { ios_base::sync_with_stdio(false); cin.tie(nullptr); int n=get_n(); int root=0; vector<int> a; for (int i = 0; i < n; i++) { if(i==root) continue; a.push_back(i+1); } sort(all(a), [root](int _a, int _b){ return is_clockwise(root+1,_a,_b); }); vector<int> conv; conv.push_back(root+1); conv.push_back(a[0]); for (int i = 1; i < sz(a); i++) { while(true){ x2=conv.back(); conv.pop_back(); x1=conv.back(); if(is_clockwise(x1,x2,a[i])){ conv.push_back(x2); break; } } conv.push_back(a[i]); } give_answer(sz(conv)); return 0; }

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

tri.cpp: In function 'int main()':
tri.cpp:27:13: error: 'x2' was not declared in this scope
   27 |             x2=conv.back();
      |             ^~
tri.cpp:29:13: error: 'x1' was not declared in this scope; did you mean 'y1'?
   29 |             x1=conv.back();
      |             ^~
      |             y1