This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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 time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |