/in/foo.cc:6:13: error: 'int time [50]' redeclared as different kind of symbol
int time[MAX]; //完成任务需要时间
^
In file included from /usr/include/pthread.h:24:0,
from /usr/include/x86_64-linux-gnu/c++/6/bits/gthr-default.h:35,
from /usr/include/x86_64-linux-gnu/c++/6/bits/gthr.h:148,
from /usr/include/c++/6/ext/atomicity.h:35,
from /usr/include/c++/6/bits/ios_base.h:39,
from /usr/include/c++/6/ios:42,
from /usr/include/c++/6/ostream:38,
from /usr/include/c++/6/iostream:39,
from /in/foo.cc:1:
/usr/include/time.h:192:15: note: previous declaration 'time_t time(time_t*)'
extern time_t time (time_t *__timer) __THROW;
^~~~
/in/foo.cc: In function 'void backtrack(int)':
/in/foo.cc:33:25: warning: pointer to a function used in arithmetic [-Wpointer-arith]
p[i] += time[dep];
^
/in/foo.cc:33:25: warning: pointer to a function used in arithmetic [-Wpointer-arith]
/in/foo.cc:33:25: error: invalid conversion from 'time_t (*)(time_t*) throw () {aka long int (*)(long int*) throw ()}' to 'int' [-fpermissive]
/in/foo.cc:35:25: warning: pointer to a function used in arithmetic [-Wpointer-arith]
p[i] -= time[dep];
^
/in/foo.cc:35:25: error: invalid operands of types 'int' and 'time_t(time_t*) throw () {aka long int(long int*) throw ()}' to binary 'operator-'
/in/foo.cc:35:25: error: in evaluation of 'operator-=(int, time_t(time_t*) throw () {aka long int(long int*) throw ()})'
/in/foo.cc: At global scope:
/in/foo.cc:41:5: error: expected initializer before 'fin'
fin >> n;
^~~
/in/foo.cc:42:5: error: 'fin' does not name a type
fin >> k;
^~~
/in/foo.cc:43:5: error: expected unqualified-id before 'for'
for(int i=1; i<=n; i++)
^~~
/in/foo.cc:43:18: error: 'i' does not name a type
for(int i=1; i<=n; i++)
^
/in/foo.cc:43:24: error: 'i' does not name a type
for(int i=1; i<=n; i++)
^
/in/foo.cc:48:11: error: expected constructor, destructor, or type conversion before '(' token
memset(p, 0, sizeof(p));
^
/in/foo.cc:50:14: error: expected constructor, destructor, or type conversion before '(' token
backtrack(1);
^
/in/foo.cc:51:5: error: 'cout' does not name a type
cout << best << endl;
^~~~
/in/foo.cc:52:5: error: 'cout' does not name a type
cout << endl;
^~~~
/in/foo.cc:53:5: error: 'cout' does not name a type
cout << endl;
^~~~
/in/foo.cc:54:5: error: 'fin' does not name a type
fin.close();
^~~
/in/foo.cc:55:5: error: expected unqualified-id before 'return'
return 0;
^~~~~~
/in/foo.cc:56:1: error: expected declaration before '}' token
}
^