Submission #424993

#TimeUsernameProblemLanguageResultExecution timeMemory
424993A_DTriangles (CEOI18_tri)C++14
Compilation error
0 ms0 KiB
#include <bits/stdc++.h>
#define ii pair<int,int>
#define F first
#define S second
#define du long double
using namespace std;
int n;
bool ok(int i,int j)
{
    int cnt=0;
    for(int k=1;k<=n;k++){
        if(k==i||k==j)continue;
        int b=is_clockwise(i,j,k);
        cnt|=(1<<b);
    }
    return cnt<3;
}
void solve()
{
    n=get_n();
    int ans=0;
    for(int i=1;i<=n;i++){
        for(int j=1;j<=n;j++){
            if(i==j)continue;
            if(ok(i,j))ans+=2;
        }
    }
    give_answer(ans);
}
main()
{
    int t=1;
    while(t--)solve();
    //cin>>t;
}






Compilation message (stderr)

tri.cpp: In function 'bool ok(int, int)':
tri.cpp:13:15: error: 'is_clockwise' was not declared in this scope
   13 |         int b=is_clockwise(i,j,k);
      |               ^~~~~~~~~~~~
tri.cpp: In function 'void solve()':
tri.cpp:20:7: error: 'get_n' was not declared in this scope
   20 |     n=get_n();
      |       ^~~~~
tri.cpp:28:5: error: 'give_answer' was not declared in this scope
   28 |     give_answer(ans);
      |     ^~~~~~~~~~~
tri.cpp: At global scope:
tri.cpp:30:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   30 | main()
      | ^~~~