QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#472475#4925. Adjacent PairsMaMengQiCompile Error//C++14888b2024-07-11 16:41:192024-07-11 16:41:21

詳細信息

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:23:18: error: expected primary-expression before ‘)’ token
   23 |                 });
      |                  ^
answer.code:25:33: error: ‘n’ was not declared in this scope
   25 |                 for(int l=1,r;l<n;l=r)
      |                                 ^
answer.code:39:31: error: ‘n’ was not declared in this scope
   39 |                 for(int i=1;i<n;i++)
      |                               ^
answer.code:45:32: error: ‘n’ was not declared in this scope
   45 |                 for(int i=1;i<=n+1;i++)
      |                                ^
answer.code:51:23: error: ‘n’ was not declared in this scope
   51 |                 cout<<n-ans<<"\n"
      |                       ^
answer.code: At global scope:
answer.code:53:9: error: expected unqualified-id before ‘return’
   53 |         return 0;
      |         ^~~~~~
answer.code:54:1: error: expected declaration before ‘}’ token
   54 | }
      | ^
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]);
      |                         ~~~~~^~~~~~~~~~~