제출 #425013

#제출 시각아이디문제언어결과실행 시간메모리
425013A_DTriangles (CEOI18_tri)C++14
컴파일 에러
0 ms0 KiB
#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=1;j<=n;j++){
            if(i==j)continue;
            if(ok(i,j))ans+=2;
        }
    }
    give_answer(ans/4);
}
main()
{
    int t=1;
    while(t--)solve();
    //cin>>t;
}
 

컴파일 시 표준 에러 (stderr) 메시지

tri.cpp: In function 'void solve()':
tri.cpp:21:24: error: 'n' was not declared in this scope
   21 |         for(int j=1;j<=n;j++){
      |                        ^
tri.cpp: At global scope:
tri.cpp:28:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   28 | main()
      | ^~~~