# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
425040 | A_D | Triangles (CEOI18_tri) | C++14 | 401 ms | 284 KiB |
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 nn;
bool ok(int i,int j)
{
int cnt=0;
for(int k=1;k<=nn;k++){
if(k==i||k==j)continue;
int b=is_clockwise(i,j,k);
cnt|=(1<<b);
}
return cnt<3;
}
void solve()
{
nn=get_n();
int ans=0;
for(int i=1;i<=nn;i++){
for(int j=i+1;j<=nn;j++){
if(i==j)continue;
if(ok(i,j))ans+=1;
}
}
give_answer(ans);
}
main()
{
int t=1;
while(t--)solve();
//cin>>t;
}
Compilation message (stderr)
# | 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... |