제출 #585073

#제출 시각아이디문제언어결과실행 시간메모리
585073hibikiTriangles (CEOI18_tri)C++11
0 / 100
3066 ms304 KiB
#include<bits/stdc++.h> #include<trilib.h> using namespace std; #define pb push_back #define sz(x) (int)x.size() int n, cnt = 0, st; vector<int> v; int main() { n = get_n(); v.pb(1); v.pb(2); for(int i = 3; i <= n; i++) { while(sz(v) > 1 && !is_clockwise(v[sz(v) - 2], v[sz(v) - 1], i)) v.pop_back(); v.pb(i); } cnt = 1; st = v[1]; int lst = v[1]; // printf("%d\n",v[1]); while(1) { for(int i = 1; i <= n; i++) { if(i == lst) continue; bool ok = true; for(int j = 1; j <= n; j++) { if(j == i || j == lst) continue; if(is_clockwise(lst, i, j)) { ok = false; break; } } if(ok) { // printf("%d %d\n",lst,i); if(i == st) { give_answer(cnt); return 0; } cnt++; lst = i; break; } } } 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...