Submission #424987

#TimeUsernameProblemLanguageResultExecution timeMemory
424987Runtime_error_Triangles (CEOI18_tri)C++14
20 / 100
1 ms292 KiB
#include "trilib.h" #include <bits/stdc++.h> using namespace std; int n; set<int> s; int go(int x){ int y = n; if(x == n) y = 1; for(int j=1;j<=n;j++){ if(j == x || j == y) continue; if(x < 1 || x>n || y<1 || y>n ) while(1); if(is_clockwise(x,y,j)) y = j; } return y; } int main(){ s.clear(); n = get_n(); for(int i=1;i<=n;i++){ int neighbour = go(i); if(s.count(neighbour)){ give_answer(n-1); return 0; } s.insert(neighbour); } give_answer(n); } /* 6 1 1 4 3 2 2 1 4 5 1 3 2 */
#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...