/ Vijos /

记录详情

Compile Error

/in/foo.cc:14:94: error: 'long int time [128]' redeclared as different kind of symbol
 int  n, m, st, ed, head_true[128], head_flase[128], tail_true[128], tail_flase[128], time[128], cost[1 << 15];
                                                                                              ^
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/istream:38,
                 from /usr/include/c++/6/fstream:38,
                 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 buildgraph()':
/in/foo.cc:70:88: warning: pointer to a function used in arithmetic [-Wpointer-arith]
                 edge[i].push_back(edgenode((i & (~tail_flase[j]))| tail_true[j], time[j]));
                                                                                        ^
/in/foo.cc:70:88: error: invalid conversion from 'time_t (*)(time_t*) throw () {aka long int (*)(long int*) throw ()}' to 'long int' [-fpermissive]
                 edge[i].push_back(edgenode((i & (~tail_flase[j]))| tail_true[j], time[j]));
                                                                                  ~~~~~~^
/in/foo.cc:20:5: note:   initializing argument 2 of 'edgenode::edgenode(long int, long int)'
     edgenode(int T = 0, int C = 0) {
     ^~~~~~~~
/in/foo.cc: In function 'void Dijkstra(long int)':
/in/foo.cc:121:27: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
         for (int z = 0; z < edge[x.dot].size(); z++)
                         ~~^~~~~~~~~~~~~~~~~~~~
/in/foo.cc: In function 'int main()':
/in/foo.cc:137:19: warning: format '%d' expects argument of type 'int*', but argument 2 has type 'long int*' [-Wformat=]
     scanf("%d", &n);
                   ^
/in/foo.cc:138:19: warning: format '%d' expects argument of type 'int*', but argument 2 has type 'long int*' [-Wformat=]
     scanf("%d", &m);
                   ^
/in/foo.cc:143:27: warning: pointer to a function used in arithmetic [-Wpointer-arith]
         scanf("%d%s",time+i, str);
                           ^
/in/foo.cc:143:33: 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=]
         scanf("%d%s",time+i, str);
                                 ^
/in/foo.cc:160:31: warning: format '%d' expects argument of type 'int', but argument 2 has type 'long int' [-Wformat=]
     else printf("%d", cost[ed]);
                               ^

信息

递交者
类型
递交
题目
P1019 补丁VS错误
语言
C++
递交时间
2020-09-15 10:39:51
评测时间
2020-09-15 10:39:51
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes