QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#350350#7933. Build PermutationZhaoZiLongCompile Error//C99933b2024-03-10 17:37:132024-03-10 17:37:14

详细

answer.code: In function ‘solve’:
answer.code:3:21: warning: implicit declaration of function ‘malloc’ [-Wimplicit-function-declaration]
    3 |     int* re = (int*)malloc(sizeof(int)*length);
      |                     ^~~~~~
answer.code:3:21: warning: incompatible implicit declaration of built-in function ‘malloc’
answer.code:1:1: note: include ‘<stdlib.h>’ or provide a declaration of ‘malloc’
  +++ |+#include <stdlib.h>
    1 | int* solve(int length, int* array)
answer.code:41:20: warning: returning ‘int’ from a function with return type ‘int *’ makes pointer from integer without a cast [-Wint-conversion]
   41 |             return -1;
      |                    ^
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x24): undefined reference to `main'
collect2: error: ld returned 1 exit status