Submission #383510

#TimeUsernameProblemLanguageResultExecution timeMemory
383510maximath_1Triangles (CEOI18_tri)C++11
0 / 100
1 ms384 KiB
#include "trilib.h" #include <iostream> #include <assert.h> #include <vector> #include <string> #include <algorithm> #include <numeric> using namespace std; void getConvexHull(){ int n = get_n(); vector<int> v(n - 1, 0); iota(v.begin(), v.end(), 2); stable_sort(v.begin(), v.end(), [&](int a, int b){ return is_clockwise(1, a, b); }); vector<int> ch; ch.push_back(1); ch.push_back(v[0]); for(int i = 1; i < v.size(); i ++){ while(ch.size() >= 2 && !is_clockwise(ch[ch.size() - 2], ch.back(), v[i])) ch.pop_back(); ch.push_back(v[i]); } give_answer(ch.size()); } int main(){ getConvexHull(); }

Compilation message (stderr)

tri.cpp: In function 'void getConvexHull()':
tri.cpp:21:19: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   21 |  for(int i = 1; i < v.size(); i ++){
      |                 ~~^~~~~~~~~~
#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...