QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#472478#4925. Adjacent PairsGuanYunchangCompile Error//C++14883b2024-07-11 16:42:202024-07-11 16:42:21

Details

answer.code: In function ‘int main()’:
answer.code:7:17: warning: format ‘%d’ expects argument of type ‘int*’, but argument 2 has type ‘int’ [-Wformat=]
    7 |         scanf("%d",t);
      |                ~^  ~
      |                 |  |
      |                 |  int
      |                 int*
answer.code:11:25: warning: format ‘%d’ expects argument of type ‘int*’, but argument 2 has type ‘int’ [-Wformat=]
   11 |                 scanf("%d",n);
      |                        ~^  ~
      |                         |  |
      |                         |  int
      |                         int*
answer.code:19:33: warning: format ‘%d’ expects argument of type ‘int*’, but argument 2 has type ‘int’ [-Wformat=]
   19 |                         scanf("%d",a[i]);
      |                                ~^  ~~~~
      |                                 |     |
      |                                 int*  int
answer.code: In lambda function:
answer.code:22:56: error: ‘c2’ was not declared in this scope; did you mean ‘c’?
   22 |                 sort(d+1,d+n+1,[&](int x,int y){return c2[x]>c2[y];});
      |                                                        ^~
      |                                                        c
answer.code: In function ‘int main()’:
answer.code:7:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    7 |         scanf("%d",t);
      |         ~~~~~^~~~~~~~
answer.code:11:22: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   11 |                 scanf("%d",n);
      |                 ~~~~~^~~~~~~~
answer.code:19:30: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   19 |                         scanf("%d",a[i]);
      |                         ~~~~~^~~~~~~~~~~