답안 #364090

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
364090 2021-02-08T08:27:07 Z soba CONSUL (info1cup19_consul) C++14
컴파일 오류
0 ms 0 KB
#include <bits/stdc++.h>
//#include "grader.h"
#include "grader.cpp"
using namespace std;
void solve(int n)
{
    int need=(n+2)/3;
    int arr[n+1];
    for(int i=1; i <= n ; i++)
    {
        arr[i]=(kth(i));
    }
    sort(arr+1, arr+n);
    int cn=1 , ans=-1;
    for(int i = 2 ; i<=n ; i++)
    {
        if(arr[i]==arr[i-1])cn++;
        else
        {
            if( (n%3==0&&cn>need) || (n%3!=0&&cn>=need))
            {
                ans=arr[i-1];
                break;
            }
            cn=1;
        }
    }
    if( (n%3==0&&cn>need) || (n%3!=0&&cn>=need))
            {
                ans=arr[n];
            }
    say_answer(ans);
}

Compilation message

/tmp/ccSTtXRv.o: In function `kth(int)':
grader.cpp:(.text+0x0): multiple definition of `kth(int)'
/tmp/ccO06EGZ.o:consul.cpp:(.text+0x0): first defined here
/tmp/ccSTtXRv.o: In function `cnt(int)':
grader.cpp:(.text+0xb0): multiple definition of `cnt(int)'
/tmp/ccO06EGZ.o:consul.cpp:(.text+0xb0): first defined here
/tmp/ccSTtXRv.o: In function `say_answer(int)':
grader.cpp:(.text+0x160): multiple definition of `say_answer(int)'
/tmp/ccO06EGZ.o:consul.cpp:(.text+0x160): first defined here
/tmp/ccSTtXRv.o: In function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'
/tmp/ccO06EGZ.o:consul.cpp:(.text.startup+0x0): first defined here
collect2: error: ld returned 1 exit status