QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#302619#2734. Professional NetworkCamillusCompile Error//C++20845b2024-01-11 00:57:202024-01-11 00:57:21

Judging History

你现在查看的是最新测评结果

  • [2024-01-11 00:57:21]
  • 评测
  • [2024-01-11 00:57:20]
  • 提交

answer

#include "bits/stdc++.h"

using ll = long long;
using namespace std;

signed main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    int n;
    cin >> n;

    vector<pair<int, int>> a(n);

    for (auto &[x, y] : a) {
        cin >> x >> y;
    }

    ranges::sort(a);

    int l = 0;
    int r = n;

    while (r - l > 1) {
        int m = (l + r) / 2;

        auto check = [&]() {
            int cnt = m;
            for (int i = 0; i < n - m; i++) {
                if (a[i] <= cnt) {
                    cnt += 1;
                } else {
                    return false;
                }
            }

            return true;
        };

        if (check()) {
            r = m;
        } else {
            l = m;
        }
    }

    cout << l << '\n';
    return 0;
}

Details

answer.code: In lambda function:
answer.code:30:26: error: no match for ‘operator<=’ (operand types are ‘__gnu_cxx::__alloc_traits<std::allocator<std::pair<int, int> >, std::pair<int, int> >::value_type’ {aka ‘std::pair<int, int>’} and ‘int’)
   30 |                 if (a[i] <= cnt) {
In file included from /usr/include/c++/11/regex:63,
                 from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:110,
                 from answer.code:1:
/usr/include/c++/11/bits/regex.h:1244:5: note: candidate: ‘template<class _Bi_iter, class _Ch_traits, class _Alloc> auto std::__cxx11::operator<=>(const std::__cxx11::sub_match<_BiIter>&, std::__cxx11::__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&)’ (reversed)
 1244 |     operator<=>(const sub_match<_Bi_iter>& __lhs,
      |     ^~~~~~~~
/usr/include/c++/11/bits/regex.h:1244:5: note:   template argument deduction/substitution failed:
answer.code:30:29: note:   mismatched types ‘const std::__cxx11::sub_match<_BiIter>’ and ‘int’
   30 |                 if (a[i] <= cnt) {
      |                             ^~~
In file included from /usr/include/c++/11/regex:63,
                 from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:110,
                 from answer.code:1:
/usr/include/c++/11/bits/regex.h:1412:5: note: candidate: ‘template<class _Bi_iter> auto std::__cxx11::operator<=>(const std::__cxx11::sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type*)’ (reversed)
 1412 |     operator<=>(const sub_match<_Bi_iter>& __lhs,
      |     ^~~~~~~~
/usr/include/c++/11/bits/regex.h:1412:5: note:   template argument deduction/substitution failed:
answer.code:30:29: note:   mismatched types ‘const std::__cxx11::sub_match<_BiIter>’ and ‘int’
   30 |                 if (a[i] <= cnt) {
      |                             ^~~
In file included from /usr/include/c++/11/regex:63,
                 from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:110,
                 from answer.code:1:
/usr/include/c++/11/bits/regex.h:1585:5: note: candidate: ‘template<class _Bi_iter> auto std::__cxx11::operator<=>(const std::__cxx11::sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type&)’ (reversed)
 1585 |     operator<=>(const sub_match<_Bi_iter>& __lhs,
      |     ^~~~~~~~
/usr/include/c++/11/bits/regex.h:1585:5: note:   template argument deduction/substitution failed:
answer.code:30:29: note:   mismatched types ‘const std::__cxx11::sub_match<_BiIter>’ and ‘int’
   30 |                 if (a[i] <= cnt) {
      |                             ^~~
In file included from /usr/include/c++/11/bits/stl_algobase.h:67,
                 from /usr/include/c++/11/bits/specfun.h:45,
                 from /usr/include/c++/11/cmath:1935,
                 from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:41,
                 from answer.code:1:
/usr/include/c++/11/bits/stl_iterator.h:538:5: note: candidate: ‘template<class _IteratorL, class _IteratorR>  requires  three_way_comparable_with<_IteratorR, _IteratorL, std::partial_ordering> constexpr std::compare_three_way_result_t<_IteratorL, _IteratorR> std::operator<=>(const std::reverse_iterator<_IteratorL>&, const std::reverse_iterator<_IteratorR>&)’ (reversed)
  538 |     operator<=>(const reverse_iterator<_IteratorL>& __x,
      |     ^~~~~~~~
/usr/include/c++/11/bits/stl_iterator.h:538:5: note:   template argument deduction/substitution failed:
answer.code:30:29: note:   mismatched types ‘const std::reverse_iterator<_IteratorL>’ and ‘int’
   30 |                 if (a[i] <= cnt) {
      |                             ^~~
In file included from /usr/include/c++/11/bits/stl_algobase.h:67,
                 from /usr/include/c++/11/bits/specfun.h:45,
                 from /usr/include/c++/11/cmath:1935,
                 from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:41,
                 from answer.code:1:
/usr/include/c++/11/bits/stl_iterator.h:1596:5: note: candidate: ‘template<class _IteratorL, class _IteratorR>  requires  three_way_comparable_with<_IteratorR, _IteratorL, std::partial_ordering> constexpr std::compare_three_way_result_t<_IteratorL, _IteratorR> std::operator<=>(const std::move_iterator<_IteratorL>&, const std::move_iterator<_IteratorR>&)’ (reversed)
 1596 |     operator<=>(const move_iterator<_IteratorL>& __x,
      |     ^~~~~~~~
/usr/include/c++/11/bits/stl_iterator.h:1596:5: note:   template argument deduction/substitution failed:
answer.code:30:29: note:   mismatched types ‘const std::move_iterator<_IteratorL>’ and ‘int’
   30 |                 if (a[i] <= cnt) {
      |                             ^~~
In file included from /usr/include/c++/11/bits/basic_string.h:48,
                 from /usr/include/c++/11/string:55,
                 from /usr/include/c++/11/bits/locale_classes.h:40,
                 from /usr/include/c++/11/bits/ios_base.h:41,
                 from /usr/include/c++/11/ios:42,
                 from /usr/include/c++/11/istream:38,
             ...