Submission #872914

#TimeUsernameProblemLanguageResultExecution timeMemory
872914Darren0724Triangles (CEOI18_tri)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> #include "trilib.h" #include "trilib.c" using namespace std; int32_t main() { int n=get_n(); int cnt=0; int ans=0; int i=1; int mn=-1; int mx=-1; int st=-1; for(int j=2;j<=n;j++){ if(st==-1){ st=j; mn=mx=j; continue; } int t=is_clockwise(i,st,j); if(t){ if(mx==-1||is_clockwise(i,mx,j)){ mx=j; } } else{ if(mn==-1||!is_clockwise(i,mn,j)){ mn=j; } } } vector<int> pt; for(int i=1;i<=n;i++){ if(i==mn){ continue; } pt.push_back(i); } sort(pt.begin(),pt.end(),[&](int a,int b){return is_clockwise(mn,a,b);}); give_answer(ans); return 0; }

Compilation message (stderr)

tri.cpp: In function 'int32_t main()':
tri.cpp:9:9: warning: unused variable 'cnt' [-Wunused-variable]
    9 |     int cnt=0;
      |         ^~~
/usr/bin/ld: /tmp/cc9u4wP9.o: in function `get_n':
tri.cpp:(.text+0x120): multiple definition of `get_n'; /tmp/cciMzJqc.o:trilib.c:(.text+0x120): first defined here
/usr/bin/ld: /tmp/cc9u4wP9.o: in function `is_clockwise':
tri.cpp:(.text+0x190): multiple definition of `is_clockwise'; /tmp/cciMzJqc.o:trilib.c:(.text+0x190): first defined here
/usr/bin/ld: /tmp/cc9u4wP9.o: in function `give_answer':
tri.cpp:(.text+0x7d0): multiple definition of `give_answer'; /tmp/cciMzJqc.o:trilib.c:(.text+0x2f0): first defined here
collect2: error: ld returned 1 exit status