Submission #872915

#TimeUsernameProblemLanguageResultExecution timeMemory
872915Darren0724Triangles (CEOI18_tri)C++17
0 / 100
1 ms348 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;
      |         ^~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...