QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#350403#7933. Build PermutationGuanYunchangCompile Error//C991.2kb2024-03-10 18:12:062024-03-10 18:12:07

Details

answer.code: In function ‘solve’:
answer.code:45:20: warning: function returns address of local variable [-Wreturn-local-addr]
   45 |             return c;
      |                    ^
answer.code: In function ‘main’:
answer.code:58:5: error: variable-sized object may not be initialized
   58 |     int b[n] = solve(n,a);
      |     ^~~
answer.code:60:16: warning: passing argument 1 of ‘printf’ makes pointer from integer without a cast [-Wint-conversion]
   60 |         printf(-1);
      |                ^~
      |                |
      |                int
In file included from /usr/include/stdio.h:867,
                 from answer.code:1:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:105:32: note: expected ‘const char * restrict’ but argument is of type ‘int’
  105 | printf (const char *__restrict __fmt, ...)
      |         ~~~~~~~~~~~~~~~~~~~~~~~^~~~~
answer.code:60:9: warning: format not a string literal and no format arguments [-Wformat-security]
   60 |         printf(-1);
      |         ^~~~~~
answer.code:64:22: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘int *’ [-Wformat=]
   64 |             printf("%d ", &b[i]);
      |                     ~^    ~~~~~
      |                      |    |
      |                      int  int *
      |                     %ls
answer.code:65:1: error: expected declaration or statement at end of input
   65 | }
      | ^
answer.code:65:1: error: expected declaration or statement at end of input
answer.code:54:5: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
   54 |     scanf("%d", &n);
      |     ^~~~~~~~~~~~~~~
answer.code:57:13: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
   57 |             scanf("%d", &a[i]);
      |             ^~~~~~~~~~~~~~~~~~