/ Vijos /

记录详情

Compile Error

foo.cpp: In function 'int read()':
foo.cpp:9:13: error: 'ch' was not declared in this scope
 int s=1,t=0;ch=getchar();
             ^
foo.cpp:9:24: error: 'getchar' was not declared in this scope
 int s=1,t=0;ch=getchar();
                        ^
foo.cpp: At global scope:
foo.cpp:18:30: error: 'edge malloc [50010]' redeclared as different kind of symbol
 }*node[MAXN+5],malloc[MAXM+10],*talloc=malloc;
                              ^
In file included from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\cstdlib:72:0,
                 from foo.cpp:2:
c:\mingw\include\stdlib.h:355:39: error: previous declaration of 'void* malloc(size_t)'
 _CRTIMP void* __cdecl __MINGW_NOTHROW malloc (size_t) __MINGW_ATTRIB_MALLOC;
                                       ^
foo.cpp:18:40: error: cannot convert 'void* (__attribute__((__cdecl__)) *)(size_t) {aka void* (__attribute__((__cdecl__)) *)(unsigned int)}' to 'edge*' in initialization
 }*node[MAXN+5],malloc[MAXM+10],*talloc=malloc;
                                        ^
foo.cpp: In function 'void add_edge(int, int, int)':
foo.cpp:20:11: warning: unused variable 'p' [-Wunused-variable]
     edge *p=talloc++;
           ^
foo.cpp: At global scope:
foo.cpp:29:1: error: 'f' does not name a type
 f[MAXN+10];
 ^
foo.cpp: In function 'int find(int)':
foo.cpp:31:8: error: 'f' was not declared in this scope
     if(f[n]==-1)return n;
        ^
foo.cpp:32:12: error: 'f' was not declared in this scope
     return f[n]=find(f[n]);
            ^
foo.cpp: In function 'int main()':
foo.cpp:41:12: error: 'f' was not declared in this scope
     memset(f,-1,sizeof(f));
            ^
foo.cpp:51:5: error: 'r' was not declared in this scope
     r=read();
     ^
foo.cpp:53:9: error: 'mission' was not declared in this scope
         mission[i].x=read();mission[i].y=read();
         ^
foo.cpp:42:11: warning: unused variable 'j' [-Wunused-variable]
     int i,j,k;
           ^
foo.cpp:42:13: warning: unused variable 'k' [-Wunused-variable]
     int i,j,k;
             ^
foo.cpp: In function 'int find(int)':
foo.cpp:33:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^

信息

递交者
类型
递交
题目
P1843 货车运输
语言
C++
递交时间
2016-11-16 16:55:23
评测时间
2016-11-16 19:07:20
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes