Submission #259157

#TimeUsernameProblemLanguageResultExecution timeMemory
259157b00n0rpFriend (IOI14_friend)C++17
Compilation error
0 ms0 KiB
#include"friend.h" #define m(a,b)a>b?a:b int n,a;int findSample(n,int c[],int h[],int p[]){while(--n)!p[n]?a+=c[n],c[h[n]]=m(0,c[h[n]]-c[n]):p[n]-2?c[h[n]]+=c[n]:c[h[n]]=m(c[h[n]],c[n]);return a+c[0];}

Compilation message (stderr)

friend.cpp:3:24: error: 'int findSample' redeclared as different kind of symbol
 int n,a;int findSample(n,int c[],int h[],int p[]){while(--n)!p[n]?a+=c[n],c[h[n]]=m(0,c[h[n]]-c[n]):p[n]-2?c[h[n]]+=c[n]:c[h[n]]=m(c[h[n]],c[n]);return a+c[0];}
                        ^
In file included from friend.cpp:1:0:
friend.h:7:5: note: previous declaration 'int findSample(int, int*, int*, int*)'
 int findSample(int n,int confidence[],int host[],int protocol[]);
     ^~~~~~~~~~
friend.cpp:3:26: error: expected primary-expression before 'int'
 int n,a;int findSample(n,int c[],int h[],int p[]){while(--n)!p[n]?a+=c[n],c[h[n]]=m(0,c[h[n]]-c[n]):p[n]-2?c[h[n]]+=c[n]:c[h[n]]=m(c[h[n]],c[n]);return a+c[0];}
                          ^~~
friend.cpp:3:34: error: expected primary-expression before 'int'
 int n,a;int findSample(n,int c[],int h[],int p[]){while(--n)!p[n]?a+=c[n],c[h[n]]=m(0,c[h[n]]-c[n]):p[n]-2?c[h[n]]+=c[n]:c[h[n]]=m(c[h[n]],c[n]);return a+c[0];}
                                  ^~~
friend.cpp:3:42: error: expected primary-expression before 'int'
 int n,a;int findSample(n,int c[],int h[],int p[]){while(--n)!p[n]?a+=c[n],c[h[n]]=m(0,c[h[n]]-c[n]):p[n]-2?c[h[n]]+=c[n]:c[h[n]]=m(c[h[n]],c[n]);return a+c[0];}
                                          ^~~