# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
256877 | b00n0rp | Friend (IOI14_friend) | C++17 | Compilation error | 0 ms | 0 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "friend.h"
#define m(a,b) a>b?a:b
int a;int findSample(int 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;}
Compilation message (stderr)
friend.cpp:3:33: error: expected ',' or '...' before '*' token int a;int findSample(int 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;} ^ friend.cpp: In function 'int findSample(int, int)': friend.cpp:3:61: error: 'p' was not declared in this scope int a;int findSample(int 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;} ^ friend.cpp:3:72: error: invalid types 'int[int]' for array subscript int a;int findSample(int 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;} ^ friend.cpp:3:76: error: 'h' was not declared in this scope int a;int findSample(int 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;} ^ friend.cpp:3:97: error: invalid types 'int[int]' for array subscript int a;int findSample(int 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;} ^ friend.cpp:2:18: note: in definition of macro 'm' #define m(a,b) a>b?a:b ^ friend.cpp:3:97: error: invalid types 'int[int]' for array subscript int a;int findSample(int 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;} ^ friend.cpp:2:22: note: in definition of macro 'm' #define m(a,b) a>b?a:b ^ friend.cpp:3:119: error: invalid types 'int[int]' for array subscript int a;int findSample(int 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;} ^ friend.cpp:3:142: error: invalid types 'int[int]' for array subscript int a;int findSample(int 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;} ^ friend.cpp:2:18: note: in definition of macro 'm' #define m(a,b) a>b?a:b ^ friend.cpp:3:142: error: invalid types 'int[int]' for array subscript int a;int findSample(int 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;} ^ friend.cpp:2:22: note: in definition of macro 'm' #define m(a,b) a>b?a:b ^ friend.cpp:3:155: error: invalid type argument of unary '*' (have 'int') int a;int findSample(int 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;} ^