Submission #424975

#TimeUsernameProblemLanguageResultExecution timeMemory
424975Runtime_error_Triangles (CEOI18_tri)C++14
0 / 100
1 ms332 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(is_clockwise(x,y,j)) y = j; } } 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 */

Compilation message (stderr)

tri.cpp: In function 'int go(int)':
tri.cpp:16:1: warning: no return statement in function returning non-void [-Wreturn-type]
   16 | }
      | ^
#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...