记录详情

Compile Error

foo.cc: In function 'void merge_sort(PII*, int, int, LL*, bool (*)(PII, PII))':
foo.cc:16:21: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
   16 |         int mid = l + r >> 1;
      |                   ~~^~~
foo.cc:6:17: error: expected ']' before ';' token
    6 | #define y second;
      |                 ^
foo.cc:26:34: note: in expansion of macro 'y'
   26 |                         cnt[q[j].y]+= mid - i + 1;
      |                                  ^
foo.cc:6:17: warning: value computed is not used [-Wunused-value]
    6 | #define y second;
      |                 ^
foo.cc:26:34: note: in expansion of macro 'y'
   26 |                         cnt[q[j].y]+= mid - i + 1;
      |                                  ^
foo.cc:6:17: warning: statement has no effect [-Wunused-value]
    6 | #define y second;
      |                 ^
foo.cc:26:34: note: in expansion of macro 'y'
   26 |                         cnt[q[j].y]+= mid - i + 1;
      |                                  ^
foo.cc:26:35: error: expected primary-expression before ']' token
   26 |                         cnt[q[j].y]+= mid - i + 1;
      |                                   ^
foo.cc: In function 'int main()':
foo.cc:5:16: error: expected '}' before ';' token
    5 | #define x first;
      |                ^
foo.cc:46:41: note: in expansion of macro 'x'
   46 |                 a[i] = b[n - i + 1] = { x,i };
      |                                         ^
foo.cc:46:39: note: to match this '{'
   46 |                 a[i] = b[n - i + 1] = { x,i };
      |                                       ^
foo.cc:5:16: error: no match for 'operator=' (operand types are 'PII' {aka 'std::pair<int, int>'} and '<brace-enclosed initializer list>')
    5 | #define x first;
      |                ^
foo.cc:46:41: note: in expansion of macro 'x'
   46 |                 a[i] = b[n - i + 1] = { x,i };
      |                                         ^
In file included from /nix/store/h5kvfrjmpw792v8jg7nrzfkffmn0iyy8-gcc-12.3.0/include/c++/12.3.0/bits/stl_algobase.h:64,
                 from /nix/store/h5kvfrjmpw792v8jg7nrzfkffmn0iyy8-gcc-12.3.0/include/c++/12.3.0/string:50,
                 from /nix/store/h5kvfrjmpw792v8jg7nrzfkffmn0iyy8-gcc-12.3.0/include/c++/12.3.0/bits/locale_classes.h:40,
                 from /nix/store/h5kvfrjmpw792v8jg7nrzfkffmn0iyy8-gcc-12.3.0/include/c++/12.3.0/bits/ios_base.h:41,
                 from /nix/store/h5kvfrjmpw792v8jg7nrzfkffmn0iyy8-gcc-12.3.0/include/c++/12.3.0/ios:42,
                 from /nix/store/h5kvfrjmpw792v8jg7nrzfkffmn0iyy8-gcc-12.3.0/include/c++/12.3.0/ostream:38,
                 from iostream:39:
/nix/store/h5kvfrjmpw792v8jg7nrzfkffmn0iyy8-gcc-12.3.0/include/c++/12.3.0/bits/stl_pair.h:593:9: note: candidate: 'template<class _U1, class _U2> typename std::enable_if<std::__and_<std::is_assignable<_T1&, const _U1&>, std::is_assignable<_T2&, const _U2&> >::value, std::pair<_T1, _T2>&>::type std::pair<_T1, _T2>::operator=(const std::pair<_U1, _U2>&) [with _U2 = _U1; _T1 = int; _T2 = int]'
  593 |         operator=(const pair<_U1, _U2>& __p)
      |         ^~~~~~~~
/nix/store/h5kvfrjmpw792v8jg7nrzfkffmn0iyy8-gcc-12.3.0/include/c++/12.3.0/bits/stl_pair.h:593:9: note:   template argument deduction/substitution failed:
foo.cc:5:16: note:   couldn't deduce template parameter '_U1'
    5 | #define x first;
      |                ^
foo.cc:46:41: note: in expansion of macro 'x'
   46 |                 a[i] = b[n - i + 1] = { x,i };
      |                                         ^
/nix/store/h5kvfrjmpw792v8jg7nrzfkffmn0iyy8-gcc-12.3.0/include/c++/12.3.0/bits/stl_pair.h:604:9: note: candidate: 'template<class _U1, class _U2> typename std::enable_if<std::__and_<std::is_assignable<_T1&, _U1&&>, std::is_assignable<_T2&, _U2&&> >::value, std::pair<_T1, _T2>&>::type std::pair<_T1, _T2>::operator=(std::pair<_U1, _U2>&&) [with _U2 = _U1; _T1 = int; _T2 = int]'
  604 |         operator=(pair<_U1, _U2>&& __p)
      |         ^~~~~~~~
/nix/store/h5kvfrjmpw792v8jg7nrzfkffmn0iyy8-gcc-12.3.0/include/c++/12.3.0/bits/stl_pair.h:604:9: note:   template argument deduction/substitution failed:
foo.cc:5:16: note:   couldn't deduce template parameter '_U1'
    5 | #define x first;
      |                ^
foo.cc:46:41: note: in expansion of macro 'x'
   46 |                 a[i] = b[n - i + 1] = { x,i };
      |                                         ^
/nix/store/h5kvfrjmpw792v8jg7nrzfkffmn0iyy8-gcc-12.3.0/include/c++/12.3.0/bits/stl_pair.h:568:7: note: candidate: 'std::pair<_T1, _T2>& std::pair<_T1, _T2>::operator=(std::__conditional_t<std::__and_<std::is_copy_assignable<_T1>, std::is_copy_assignable<_T2> >::value, const std::pair<_T1, _T2>&, const std::__nonesuch&>) [with _T1 = int; _T2 = int; std::__conditional_t<std::__and_<std::is_copy_assignable<_T1>, std::is_copy_assignable<_T2> >::value, const std::pair<_T1, _T2>&, const std::__nonesuch&> = const std::pair<int, int>&]'
  568 |       operator=(__conditional_t<__and_<is_copy_assignable<_T1>,
      |       ^~~~~~~~
/nix/store/h5kvfrjmpw792v8jg7nrzfkffmn0iyy8-gcc-12.3.0/include/c++/12.3.0/bits/stl_pair.h:570:65: note:   no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'std::__conditional_t<true, const std::pair<int, int>&, const std::__nonesuch&>' {aka 'const std::pair<int, int>&'}
  568 |       operator=(__conditional_t<__and_<is_copy_assignable<_T1>,
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  
  569 |                                        is_copy_assignable<_T2>>::value,
      |                                        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  570 |                                 const pair&, const __nonesuch&> __p)
      |                                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
/nix/store/h5kvfrjmpw792v8jg7nrzfkffmn0iyy8-gcc-12.3.0/include/c++/12.3.0/bits/stl_pair.h:578:7: note: candidate: 'std::pair<_T1, _T2>& std::pair<_T1, _T2>::operator=(std::__conditional_t<std::__and_<std::is_move_assignable<_Tp>, std::is_move_assignable<_T2> >::value, std::pair<_T1, _T2>&&, std::__nonesuch&&>) [with _T1 = int; _T2 = int; std::__conditional_t<std::__and_<std::is_move_assignable<_Tp>, std::is_move_assignable<_T2> >::value, std::pair<_T1, _T2>&&, std::__nonesuch&&> = std::pair<int, int>&&]'
  578 |       operator=(__conditional_t<__and_<is_move_assignable<_T1>,
      |       ^~~~~~~~
/nix/store/h5kvfrjmpw792v8jg7nrzfkffmn0iyy8-gcc-12.3.0/include/c++/12.3.0/bits/stl_pair.h:580:55: note:   no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'std::__conditional_t<true, std::pair<int, int>&&, std::__nonesuch&&>' {aka 'std::pair<int, int>&&'}
  578 |       operator=(__conditional_t<__and_<is_move_assignable<_T1>,
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  579 |                                        is_move_assignable<_T2>>::value,
      |                                        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  580 |                                 pair&&, __nonesuch&&> __p)
      |                                 ~~~~~~~~~~~~~~~~~~~~~~^~~
foo.cc:46:42: error: expected primary-expression before ',' token
   46 |                 a[i] = b[n - i + 1] = { x,i };
      |                                          ^
foo.cc: At global scope:
foo.cc:48:19: error: expected constructor, destructor, or type conversion before '(' token
   48 |         merge_sort(a, 1, n, cnta, [](PII a, PII b) {
      |                   ^
foo.cc:50:10: error: expected unqualified-id before ')' token
   50 |         });
      |          ^
foo.cc:51:19: error: expected constructor, destructor, or type conversion before '(' token
   51 |         merge_sort(a, 1, n, cntb, [](PII a, PII b){
      |                   ^
foo.cc:53:10: error: expected unqualified-id before ')' token
   53 |         });
      |          ^
foo.cc:55:9: error: expected unqualified-id before 'for'
   55 |         for (int i = 1; i <= n; i++) {
      |         ^~~
foo.cc:55:25: error: 'i' does not name a type
   55 |         for (int i = 1; i <= n; i++) {
      |                         ^
foo.cc:55:33: error: 'i' does not name a type
   55 |         for (int i = 1; i <= n; i++) {
      |                                 ^
foo.cc:60:9: error: 'cout' does not name a type
   60 |         cout << ans;
      |         ^~~~
foo.cc:61:9: error: expected unqualified-id before 'return'
   61 |         return 0;
      |         ^~~~~~
foo.cc:62:1: error: expected declaration before '}' token
   62 | }
      | ^
[Hydro](https://hydro.ac)提供评测服务

信息

递交者
类型
递交
题目
P1510 Problem 2C. 云骑军队列
语言
C++
递交时间
2023-10-31 14:18:48
评测时间
2023-10-31 14:18:48
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes