/ Vijos /

记录详情

Compile Error

foo.cc: In function ‘void solve()’:
foo.cc:17:17: error: missing template arguments before ‘M’
   17 |     std::vector M(n + 2, std::vector(n + 2, 0));
      |                 ^
foo.cc:22:38: error: ‘M’ was not declared in this scope
   22 |         if (i >= 1 && i <= n) a[i] = M[i][i] = x;
      |                                      ^
foo.cc:24:35: error: ‘M’ was not declared in this scope
   24 |     rep(i, 1, n) rep(j, i + 1, n) M[i][j] = std::max(M[i][j - 1], a[j]);
      |                                   ^
foo.cc:26:17: error: missing template arguments before ‘f’
   26 |     std::vector f(n + 2, std::vector(n + 2, std::vector(2, inf)));
      |                 ^
foo.cc:27:5: error: ‘f’ was not declared in this scope
   27 |     f[1][n][0] = f[1][n][1] = 0;
      |     ^
foo.cc:31:31: error: ‘M’ was not declared in this scope
   31 |             {f[i - 1][j][0] + M[i - 1][j],
      |                               ^
foo.cc:30:30: error: no matching function for call to ‘min(<brace-enclosed initializer list>)’
   30 |         f[i][j][0] = std::min(
      |                      ~~~~~~~~^
   31 |             {f[i - 1][j][0] + M[i - 1][j],
      |             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   32 |              f[i - 1][j][1] + (n - k) * M[i - 1][j],
      |              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   33 |              f[i][j + 1][1] + (n - k + 1) * M[i][j + 1]}
      |              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   34 |         );
      |         ~                     
In file included from /nix/gcc/include/c++/13.3.0/algorithm:60,
                 from foo.cc:1:
/nix/gcc/include/c++/13.3.0/bits/stl_algobase.h:233:5: note: candidate: ‘template<class _Tp> const _Tp& std::min(const _Tp&, const _Tp&)’
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/nix/gcc/include/c++/13.3.0/bits/stl_algobase.h:233:5: note:   template argument deduction/substitution failed:
foo.cc:30:30: note:   candidate expects 2 arguments, 1 provided
   30 |         f[i][j][0] = std::min(
      |                      ~~~~~~~~^
   31 |             {f[i - 1][j][0] + M[i - 1][j],
      |             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   32 |              f[i - 1][j][1] + (n - k) * M[i - 1][j],
      |              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   33 |              f[i][j + 1][1] + (n - k + 1) * M[i][j + 1]}
      |              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   34 |         );
      |         ~                     
/nix/gcc/include/c++/13.3.0/bits/stl_algobase.h:281:5: note: candidate: ‘template<class _Tp, class _Compare> const _Tp& std::min(const _Tp&, const _Tp&, _Compare)’
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/nix/gcc/include/c++/13.3.0/bits/stl_algobase.h:281:5: note:   template argument deduction/substitution failed:
foo.cc:30:30: note:   candidate expects 3 arguments, 1 provided
   30 |         f[i][j][0] = std::min(
      |                      ~~~~~~~~^
   31 |             {f[i - 1][j][0] + M[i - 1][j],
      |             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   32 |              f[i - 1][j][1] + (n - k) * M[i - 1][j],
      |              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   33 |              f[i][j + 1][1] + (n - k + 1) * M[i][j + 1]}
      |              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   34 |         );
      |         ~                     
In file included from /nix/gcc/include/c++/13.3.0/algorithm:61:
/nix/gcc/include/c++/13.3.0/bits/stl_algo.h:5775:5: note: candidate: ‘template<class _Tp> _Tp std::min(initializer_list<_Tp>)’
 5775 |     min(initializer_list<_Tp> __l)
      |     ^~~
/nix/gcc/include/c++/13.3.0/bits/stl_algo.h:5775:5: note:   template argument deduction/substitution failed:
/nix/gcc/include/c++/13.3.0/bits/stl_algo.h:5785:5: note: candidate: ‘template<class _Tp, class _Compare> _Tp std::min(initializer_list<_Tp>, _Compare)’
 5785 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/nix/gcc/include/c++/13.3.0/bits/stl_algo.h:5785:5: note:   template argument deduction/substitution failed:
foo.cc:35:30: error: no matching function for call to ‘min(<brace-enclosed initializer list>)’
   35 |         f[i][j][1] = std::min(
      |                      ~~~~~~~~^
   36 |             {f[i][j + 1][1] + M[i][j + 1],
      |             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   37 |              f[i][j + 1][0] + (n - k) * M[i][j + 1],
      |              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   38 |              f[i - 1][j][0] + (n - k + 1) * M[i - 1][j]}
      |              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   39 |         );
      |         ~                     
/nix/gcc/include/c++/13.3.0/bits/stl_algobase.h:233:5: note: candidate: ‘template<class _Tp> const _Tp& std::min(const _Tp&, const _Tp&)’
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/nix/gcc/include/c++/13.3.0/bits/stl_algobase.h:233:5: note:   template argument deduction/substitution failed:
foo.cc:35:30: note:   candidate expects 2 arguments, 1 provided
   35 |         f[i][j][1] = std::min(
      |                      ~~~~~~~~^
   36 |             {f[i][j + 1][1] + M[i][j + 1],
      |             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   37 |              f[i][j + 1][0] + (n - k) * M[i][j + 1],
      |              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   38 |              f[i - 1][j][0] + (n - k + 1) * M[i - 1][j]}
      |              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   39 |         );
      |         ~                     
/nix/gcc/include/c++/13.3.0/bits/stl_algobase.h:281:5: note: candidate: ‘template<class _Tp, class _Compare> const _Tp& std::min(const _Tp&, const _Tp&, _Compare)’
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/nix/gcc/include/c++/13.3.0/bits/stl_algobase.h:281:5: note:   template argument deduction/substitution failed:
foo.cc:35:30: note:   candidate expects 3 arguments, 1 provided
   35 |         f[i][j][1] = std::min(
      |                      ~~~~~~~~^
   36 |             {f[i][j + 1][1] + M[i][j + 1],
      |             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   37 |              f[i][j + 1][0] + (n - k) * M[i][j + 1],
      |              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   38 |              f[i - 1][j][0] + (n - k + 1) * M[i - 1][j]}
      |              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   39 |         );
      |         ~                     
/nix/gcc/include/c++/13.3.0/bits/stl_algo.h:5775:5: note: candidate: ‘template<class _Tp> _Tp std::min(initializer_list<_Tp>)’
 5775 |     min(initializer_list<_Tp> __l)
      |     ^~~
/nix/gcc/include/c++/13.3.0/bits/stl_algo.h:5775:5: note:   template argument deduction/substitution failed:
/nix/gcc/include/c++/13.3.0/bits/stl_algo.h:5785:5: note: candidate: ‘template<class _Tp, class _Compare> _Tp std::min(initializer_list<_Tp>, _Compare)’
 5785 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/nix/gcc/include/c++/13.3.0/bits/stl_algo.h:5785:5: note:   template argument deduction/substitution failed:

信息

递交者
类型
递交
题目
P1451 圆环取数
语言
C++
递交时间
2025-09-13 13:31:40
评测时间
2025-09-23 07:23:50
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes