Borderou de evaluare (job #2369494)

Utilizator BogdanRazvanBogdan Razvan BogdanRazvan Data 5 martie 2019 23:59:35
Problema Secventa 3 Status done
Runda Arhiva de probleme Compilator cpp-64 | Vezi sursa
Scor 0

Raport evaluator

Eroare de compilare: main.cpp:4:28: error: 'int time [30005]' redeclared as different kind of symbol int cost[30005], time[30005], d[30005]; ^ 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 main.cpp:1: /usr/include/time.h:192:15: note: previous declaration 'time_t time(time_t*)' extern time_t time (time_t *__timer) __THROW; ^~~~ main.cpp: In function 'int main()': main.cpp:13:52: warning: pointer to a function used in arithmetic [-Wpointer-arith] for(int i = 1; i <= n; ++i) scanf("%d", &time[i]); ^ main.cpp:13:53: warning: format '%d' expects argument of type 'int*', but argument 2 has type 'time_t (*)(time_t*) throw () {aka long int (*)(long int*) throw ()}' [-Wformat=] for(int i = 1; i <= n; ++i) scanf("%d", &time[i]); ^ main.cpp:15:83: warning: pointer to a function used in arithmetic [-Wpointer-arith] for(int i = 1; i <= mn; ++i) d[++L] = i, sum1 += cost[d[L]], sum2 += time[d[L]]; ^ main.cpp:15:83: warning: pointer to a function used in arithmetic [-Wpointer-arith] main.cpp:15:83: error: invalid conversion from 'time_t (*)(time_t*) throw () {aka long int (*)(long int*) throw ()}' to 'int' [-fpermissive] main.cpp:18:46: warning: pointer to a function used in arithmetic [-Wpointer-arith] sum1 -= cost[d[F]], sum2 -= time[d[F]]; ^ main.cpp:18:46: error: invalid operands of types 'int' and 'time_t(time_t*) throw () {aka long int(long int*) throw ()}' to binary 'operator-' main.cpp:18:46: error: in evaluation of 'operator-=(int, time_t(time_t*) throw () {aka long int(long int*) throw ()})' main.cpp:20:46: warning: pointer to a function used in arithmetic [-Wpointer-arith] sum1 += cost[d[L]], sum2 += time[d[L]]; ^ main.cpp:20:46: warning: pointer to a function used in arithmetic [-Wpointer-arith] main.cpp:20:46: error: invalid conversion from 'time_t (*)(time_t*) throw () {aka long int (*)(long int*) throw ()}' to 'int' [-fpermissive] main.cpp:7:36: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)', declared with attribute warn_unused_result [-Wunused-result] freopen("secv3.in", "r", stdin); ^ main.cpp:8:38: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)', declared with attribute warn_unused_result [-Wunused-result] freopen("secv3.out", "w", stdout); ^ main.cpp:11:34: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result] scanf("%d%d%d", &n, &mn, &mx); ^ main.cpp:12:54: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result] for(int i = 1; i <= n; ++i) scanf("%d", &cost[i]); ^ main.cpp:13:54: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result] Non zero exit status: 1

Ceva nu functioneaza?