/ Vijos /

记录详情

Compile Error

/in/foo.cc: In function 'int main()':
/in/foo.cc:56:16: warning: format '%d' expects argument of type 'int*', but argument 2 has type 'long long int*' [-Wformat=]
   56 |     scanf("%I64d%I64d",&n,&k);
      |            ~~~~^       ~~
      |                |       |
      |                int*    long long int*
      |            %I64lld
/in/foo.cc:56:21: warning: format '%d' expects argument of type 'int*', but argument 3 has type 'long long int*' [-Wformat=]
   56 |     scanf("%I64d%I64d",&n,&k);
      |                 ~~~~^     ~~
      |                     |     |
      |                     int*  long long int*
      |                 %I64lld
/in/foo.cc:58:20: warning: format '%d' expects argument of type 'int*', but argument 2 has type 'long long int*' [-Wformat=]
   58 |         scanf("%I64d",&a[i]);
      |                ~~~~^  ~~~~~
      |                    |  |
      |                    |  long long int*
      |                    int*
      |                %I64lld
/in/foo.cc:60:20: warning: format '%d' expects argument of type 'int*', but argument 2 has type 'long long int*' [-Wformat=]
   60 |         scanf("%I64d",&b[i]);
      |                ~~~~^  ~~~~~
      |                    |  |
      |                    |  long long int*
      |                    int*
      |                %I64lld
/in/foo.cc:80:17: warning: format '%d' expects argument of type 'int', but argument 2 has type 'long long int' [-Wformat=]
   80 |     printf("%I64d\n",total);
      |             ~~~~^    ~~~~~
      |                 |    |
      |                 int  long long int
      |             %I64lld
/in/foo.cc: In instantiation of 'void quicksort(T*, T*) [with T = long long int]':
/in/foo.cc:24:14:   required from here
/in/foo.cc:12:20: error: invalid conversion from 'long long int*' to 'long long int' [-fpermissive]
   12 |     T*l=begin,r=end-1;
      |                 ~~~^~
      |                    |
      |                    long long int*
/in/foo.cc:13:12: error: invalid operands of types 'long long int' and 'long long int*' to binary 'operator-'
   13 |     for (;r-l>=0;) {
      |           ~^~
/in/foo.cc:15:15: error: invalid type argument of unary '*' (have 'long long int')
   15 |         while(*r<p) r--;
      |               ^~
/in/foo.cc:16:22: error: invalid type argument of unary '*' (have 'long long int')
   16 |         std::swap(*l,*r);l++;r--;
      |                      ^~
/in/foo.cc:18:14: error: no matching function for call to 'quicksort(long long int*&, long long int)'
   18 |     quicksort(begin,r+1);
      |     ~~~~~~~~~^~~~~~~~~~~
/in/foo.cc:9:6: note: candidate: 'template<class T> void quicksort(T*, T*)'
    9 | void quicksort(T* begin,T*end) {
      |      ^~~~~~~~~
/in/foo.cc:9:6: note:   template argument deduction/substitution failed:
/in/foo.cc:18:14: note:   mismatched types 'T*' and 'long long int'
   18 |     quicksort(begin,r+1);
      |     ~~~~~~~~~^~~~~~~~~~~

信息

递交者
类型
递交
题目
P1662 最大配对
语言
C++
递交时间
2025-06-29 14:37:46
评测时间
2025-06-29 14:37:46
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes