제출 #1053573

#제출 시각아이디문제언어결과실행 시간메모리
1053573antonTriangles (CEOI18_tri)C++17
55 / 100
61 ms604 KiB
#include<bits/stdc++.h> #include"trilib.h" using namespace std; int N; int get_cand(int u){ int cur= 0; if(u == 0){ cur++; } for(int i = 0; i<N; i++){ if(i!=u && i!=cur && u!=cur){ if(is_clockwise(u+1, cur+1, i+1)){ cur= i; } } } return cur; } bool is_bound(int a, int b){ for(int i = 0; i<N; i++){ if(i!= a && i!=b && a!=b){ if(is_clockwise(a+1, b+1, i+1)){ return false; } } } return true; } signed main(){ N = get_n(); int res= 0; int cur_point =0; int hull_begin = -1; for(int i = 0; i<N &&hull_begin ==-1; i++){ int j = get_cand(i); if(is_bound(i, j)){ res++; hull_begin = i; cur_point = j; } } while(cur_point != hull_begin){ cur_point = get_cand(cur_point); res++; } cout<<res<<endl; }
#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...