제출 #791965

#제출 시각아이디문제언어결과실행 시간메모리
791965ttamxTriangles (CEOI18_tri)C++14
컴파일 에러
0 ms0 KiB
#include"trilib.c" #include<bits/stdc++.h> using namespace std; vector<int> lower,upper; deque<int> hull; set<int> ans; bool cmp(int x,int y){ return is_clockwise(1,x,y); } void upd(int x){ while(hull.size()>1&&!is_clockwise(hull.end()[-2],hull.back(),x))hull.pop_back(); hull.emplace_back(x); } int main(){ cin.tie(nullptr)->sync_with_stdio(false); int n; n=get_n(); for(int i=3;i<=n;i++){ if(is_clockwise(1,2,i))upper.emplace_back(i); else lower.emplace_back(i); } sort(lower.begin(),lower.end(),cmp); sort(upper.begin(),upper.end(),cmp); for(int i=0;i<2;i++){ upd(1); for(auto x:lower)upd(x); upd(2); for(auto x:upper)upd(x); } for(auto x:hull)ans.emplace(x); give_answer(ans.size()); }

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

/usr/bin/ld: /tmp/ccpUMKaU.o: in function `get_n':
tri.cpp:(.text+0x120): multiple definition of `get_n'; /tmp/ccEayB6U.o:trilib.c:(.text+0x120): first defined here
/usr/bin/ld: /tmp/ccpUMKaU.o: in function `is_clockwise':
tri.cpp:(.text+0x190): multiple definition of `is_clockwise'; /tmp/ccEayB6U.o:trilib.c:(.text+0x190): first defined here
/usr/bin/ld: /tmp/ccpUMKaU.o: in function `give_answer':
tri.cpp:(.text+0x310): multiple definition of `give_answer'; /tmp/ccEayB6U.o:trilib.c:(.text+0x2f0): first defined here
collect2: error: ld returned 1 exit status