/ Vijos /

记录详情

Compile Error

/in/foo.cc:4:13: warning: ISO C++11 requires whitespace after the macro name
 #define maxn[5001];
             ^
/in/foo.cc:4:14: error: expected ']' before numeric constant
 #define maxn[5001];
              ^
/in/foo.cc:5:12: note: in expansion of macro 'maxn'
 int father[maxn];
            ^~~~
/in/foo.cc:5:16: error: expected unqualified-id before ']' token
 int father[maxn];
                ^
/in/foo.cc: In function 'int find(int)':
/in/foo.cc:9:13: error: invalid types 'int[int]' for array subscript
  if(father[x]!=x)
             ^
/in/foo.cc:10:18: error: invalid types 'int[int]' for array subscript
   return father[x]=find([father[x]);
                  ^
/in/foo.cc:10:26: warning: capture of variable 'father' with non-automatic storage duration
   return father[x]=find([father[x]);
                          ^~~~~~
/in/foo.cc:5:5: note: 'int father' declared here
 int father[maxn];
     ^~~~~~
/in/foo.cc:10:32: error: expected ',' before '[' token
   return father[x]=find([father[x]);
                                ^
/in/foo.cc:10:32: error: expected identifier before '[' token
/in/foo.cc:10:36: error: expected ']' before ';' token
   return father[x]=find([father[x]);
                                    ^
/in/foo.cc: In lambda function:
/in/foo.cc:10:36: error: expected '{' before ';' token
/in/foo.cc: In function 'int find(int)':
/in/foo.cc:10:36: error: expected ')' before ';' token
/in/foo.cc: In function 'void con(int, int)':
/in/foo.cc:14:11: error: invalid types 'int[int]' for array subscript
  father[l2]=l1;
           ^
/in/foo.cc: In function 'int main()':
/in/foo.cc:18:15: warning: left operand of comma operator has no effect [-Wunused-value]
  for(int i=1;i<=n,i++)
              ~^~~
/in/foo.cc:18:22: error: expected ';' before ')' token
  for(int i=1;i<=n,i++)
                      ^
/in/foo.cc:20:11: error: invalid types 'int[int]' for array subscript
   father[i]=i;
           ^
/in/foo.cc:34:18: error: 'ptintf' was not declared in this scope
    ptintf("Yes\n");
                  ^

信息

递交者
类型
自测
题目
P1034 家族
语言
C++
递交时间
2018-08-10 11:57:52
评测时间
2018-08-10 11:57:52
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes