Submission #1039220

#TimeUsernameProblemLanguageResultExecution timeMemory
1039220slivajanTriangles (CEOI18_tri)C++17
20 / 100
1 ms760 KiB
#include "trilib.h" #include <bits/stdc++.h> using namespace std; typedef long long un; typedef vector<un> vuc; typedef set<un> sun; #define vec vector #define REP(i, a, b) for (un i = (un)a; i < (un)b; i++) #define FEAC(i, a) for (auto&& i : a) #define ALL(x) (x).begin(), (x).end() un N; vuc horni; vuc dolni; vuc cely; vuc obal; int main(){ N = get_n(); // if (N == 3){ // give_answer(3); // return 0; // } REP(i, 3, N+1){ if (not is_clockwise(1, 2, i)) horni.push_back(i); else dolni.push_back(i); } horni.push_back(2); dolni.push_back(2); sort(ALL(horni), [](un x, un y){return is_clockwise(1, x, y); }); sort(ALL(dolni), [](un x, un y){return is_clockwise(1, x, y); }); FEAC(a, horni) cely.push_back(a); cely.pop_back(); FEAC(a, dolni) cely.push_back(a); obal.push_back(1); FEAC(a, cely){ while((obal.size() != 1) and (not is_clockwise(obal[obal.size()-2], obal[obal.size()-1], a))){ obal.pop_back(); } obal.push_back(a); } un ign = 0; while (not is_clockwise(obal[obal.size()-1], obal[ign], obal[ign+1])) { ign++; } give_answer(obal.size()-ign); }
#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...