Submission #410492

#TimeUsernameProblemLanguageResultExecution timeMemory
410492abdzagTriangles (CEOI18_tri)C++17
35 / 100
1681 ms312 KiB
#include<bits/stdc++.h> #include<unordered_map> #include "trilib.h" #define rep(i,a,b) for(int i=int(a);i<int(b);i++) #define rrep(i,a,b) for(int i=int(a);i>int(b);i--) #define all(v) v.begin(),v.end() #define trav(a,v) for(auto&a:v) #define sz(a) a.size() typedef long double ld; using namespace std; const long long inf = 1e15; typedef long long ll; typedef unsigned long long ull; int n = get_n(); int main() { vector<ll> res(n + 1, -1); rep(i, 1, n + 1) { if (res[i] != -1) { continue; } rep(j, 1, n + 1) { if (i == j)continue; if (j == 0)continue; ll cur = 0; bool done = true; rep(z, 1, n + 1) { if (z == i || z == j)continue; if (is_clockwise(i, j, z)) { done = false; if (cur == -1)break; cur = 1; } else if (is_clockwise(i, j, z)) { done = false; if (cur == 1)break; cur = -1; } } if (done) { res[i] = 1; res[j] = 1; break; } } if (res[i] == -1)res[i] = 0; } ll ans = 0; rep(i, 1, n + 1)ans += res[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...