제출 #898372

#제출 시각UTC-0아이디문제언어결과실행 시간메모리
8983722024-01-04 14:43:57math_rabbit_1028Triangles (CEOI18_tri)C++14
100 / 100
17 ms2224 KiB
#include <bits/stdc++.h>
#include "trilib.h"
using namespace std;
int n;
vector<int> up, dn;
void solve() {
n = get_n();
for (int i = 3; i <= n; i++) {
if (is_clockwise(1, 2, i)) dn.push_back(i);
else up.push_back(i);
}
sort(up.begin(), up.end(), [](int i, int j){ return is_clockwise(i, 1, j); });
sort(dn.begin(), dn.end(), [](int i, int j){ return !is_clockwise(i, 1, j); });
stack<int> stk;
deque<int> dq;
dq.push_back(1);
dq.push_back(2);
for (int i = 0; i < up.size(); i++) {
int a = dq.back(); dq.pop_back();
while (dq.size() >= 1 && is_clockwise(dq.back(), a, up[i])) {
a = dq.back(); dq.pop_back();
}
dq.push_back(a);
dq.push_back(up[i]);
}
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

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

tri.cpp: In function 'void solve()':
tri.cpp:23:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   23 |     for (int i = 0; i < up.size(); i++) {
      |                     ~~^~~~~~~~~~~
tri.cpp:36:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   36 |     for (int i = 0; i < dn.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...