제출 #1039223

#제출 시각아이디문제언어결과실행 시간메모리
10392230npataTriangles (CEOI18_tri)C++17
55 / 100
1280 ms980 KiB
#include<bits/stdc++.h> #include "trilib.h" using namespace std; int n; bool is_clockw(int i, int j, int k) { return is_clockwise(i+1, j+1, k+1); } bool is_on_convex_hull(int i) { int mx = i == 0 ? 1 : 0; for(int j = 0; j<n; j++) { if(j == i || j == mx) continue; if(is_clockw(i, mx, j)) mx = j; } for(int j = 0; j<n; j++) { if(j == i || j == mx) continue; if(is_clockw(i, mx, j)) return false; } return true; } int32_t main() { n = get_n(); int ans = 0; for(int i = 0; i<n; i++) { ans += is_on_convex_hull(i); } give_answer(ans); return 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...