Submission #1051680

#TimeUsernameProblemLanguageResultExecution timeMemory
1051680antonTriangles (CEOI18_tri)C++17
35 / 100
464 ms29856 KiB
#include<bits/stdc++.h> #include"trilib.h" using namespace std; int N; signed main(){ N = get_n(); vector<vector<vector<bool>>> above(N, vector<vector<bool>>(N, vector<bool>(N, false))); for(int i = 0; i<N; i++){ for(int j = i+1; j<N; j++){ for(int k = j+1; k<N; k++){ bool this_order = is_clockwise(i+1, j+1, k+1); above[i][j][k] = this_order; above[j][k][i] = this_order; above[k][i][j] = this_order; above[k][j][i] = !this_order; above[j][i][k] = !this_order; above[i][k][j] = !this_order; } } } int res= 0; for(int i = 0; i<N; i++){ for(int j = 0; j<N; j++){ int count_above = 0; for(int k = 0; k<N; k++){ if(above[i][j][k]){ count_above++; } } if(count_above == N-2){ res++; } } } cout<<res<<endl; }
#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...