Submission #585063

#TimeUsernameProblemLanguageResultExecution timeMemory
585063hibikiTriangles (CEOI18_tri)C++11
20 / 100
3020 ms300 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, lst; 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 = lst = 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...