Submission #364090

#TimeUsernameProblemLanguageResultExecution timeMemory
364090sobaCONSUL (info1cup19_consul)C++14
Compilation error
0 ms0 KiB
#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 (stderr)

/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