제출 #383521

#제출 시각UTC-0아이디문제언어결과실행 시간메모리
3835212021-03-30 08:27:28maximath_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>
#include <deque>
using namespace std;
void getConvexHull(){
int n = get_n();
vector<int> v[2];
deque<int> ch;
v[0].push_back(1); v[0].push_back(2);
for(int i = 3; i <= n; i ++)
v[is_clockwise(1, 2, i)].push_back(i);
for(int tp = 0; tp < 2; tp ++){
sort(v[tp].begin() + (tp == 0), v[tp].end(), [&](int a, int b){
return is_clockwise(1, a, b);
});
for(int i = 0; i < v[tp].size(); i ++){
while(ch.size() >= 2 && !is_clockwise(ch[ch.size() - 2], ch.back(), v[tp][i]))
ch.pop_back();
ch.push_back(v[tp][i]);
}
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

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

tri.cpp: In function 'void getConvexHull()':
tri.cpp:26:20: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   26 |   for(int i = 0; i < v[tp].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...