fork download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. struct querie{
  4. int f;
  5. int s;
  6. int k;
  7. int index;
  8. };
  9. int main()
  10. {
  11. int n;
  12. cin>>n;
  13. querie A[n];
  14. for(int i=0;i<n;i++){
  15. cin>>A[i].f>>A[i].s>>A[i].k;
  16. A[i].index=i;
  17. }
  18. sort(A,A+n);
  19.  
  20. return 0;
  21. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
In file included from /usr/include/c++/8/bits/stl_algobase.h:71,
                 from /usr/include/c++/8/bits/char_traits.h:39,
                 from /usr/include/c++/8/ios:40,
                 from /usr/include/c++/8/istream:38,
                 from /usr/include/c++/8/sstream:38,
                 from /usr/include/c++/8/complex:45,
                 from /usr/include/c++/8/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/8/bits/stdc++.h:52,
                 from prog.cpp:1:
/usr/include/c++/8/bits/predefined_ops.h: In instantiation of ‘constexpr bool __gnu_cxx::__ops::_Iter_less_iter::operator()(_Iterator1, _Iterator2) const [with _Iterator1 = querie*; _Iterator2 = querie*]’:
/usr/include/c++/8/bits/stl_algo.h:1847:14:   required from ‘void std::__insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = querie*; _Compare = __gnu_cxx::__ops::_Iter_less_iter]’
/usr/include/c++/8/bits/stl_algo.h:1885:25:   required from ‘void std::__final_insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = querie*; _Compare = __gnu_cxx::__ops::_Iter_less_iter]’
/usr/include/c++/8/bits/stl_algo.h:1971:31:   required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = querie*; _Compare = __gnu_cxx::__ops::_Iter_less_iter]’
/usr/include/c++/8/bits/stl_algo.h:4834:18:   required from ‘void std::sort(_RAIter, _RAIter) [with _RAIter = querie*]’
prog.cpp:18:15:   required from here
/usr/include/c++/8/bits/predefined_ops.h:43:23: error: no match for ‘operator<’ (operand types are ‘querie’ and ‘querie’)
       { return *__it1 < *__it2; }
                ~~~~~~~^~~~~~~~
In file included from /usr/include/c++/8/bits/stl_algobase.h:67,
                 from /usr/include/c++/8/bits/char_traits.h:39,
                 from /usr/include/c++/8/ios:40,
                 from /usr/include/c++/8/istream:38,
                 from /usr/include/c++/8/sstream:38,
                 from /usr/include/c++/8/complex:45,
                 from /usr/include/c++/8/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/8/bits/stdc++.h:52,
                 from prog.cpp:1:
/usr/include/c++/8/bits/stl_iterator.h:892:5: note: candidate: ‘template<class _IteratorL, class _IteratorR, class _Container> bool __gnu_cxx::operator<(const __gnu_cxx::__normal_iterator<_IteratorL, _Container>&, const __gnu_cxx::__normal_iterator<_IteratorR, _Container>&)’
     operator<(const __normal_iterator<_IteratorL, _Container>& __lhs,
     ^~~~~~~~
/usr/include/c++/8/bits/stl_iterator.h:892:5: note:   template argument deduction/substitution failed:
In file included from /usr/include/c++/8/bits/stl_algobase.h:71,
                 from /usr/include/c++/8/bits/char_traits.h:39,
                 from /usr/include/c++/8/ios:40,
                 from /usr/include/c++/8/istream:38,
                 from /usr/include/c++/8/sstream:38,
                 from /usr/include/c++/8/complex:45,
                 from /usr/include/c++/8/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/8/bits/stdc++.h:52,
                 from prog.cpp:1:
/usr/include/c++/8/bits/predefined_ops.h:43:23: note:   ‘querie’ is not derived from ‘const __gnu_cxx::__normal_iterator<_IteratorL, _Container>’
       { return *__it1 < *__it2; }
                ~~~~~~~^~~~~~~~
In file included from /usr/include/c++/8/bits/stl_algobase.h:67,
                 from /usr/include/c++/8/bits/char_traits.h:39,
                 from /usr/include/c++/8/ios:40,
                 from /usr/include/c++/8/istream:38,
                 from /usr/include/c++/8/sstream:38,
                 from /usr/include/c++/8/complex:45,
                 from /usr/include/c++/8/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/8/bits/stdc++.h:52,
                 from prog.cpp:1:
/usr/include/c++/8/bits/stl_iterator.h:899:5: note: candidate: ‘template<class _Iterator, class _Container> bool __gnu_cxx::operator<(const __gnu_cxx::__normal_iterator<_Iterator, _Container>&, const __gnu_cxx::__normal_iterator<_Iterator, _Container>&)’
     operator<(const __normal_iterator<_Iterator, _Container>& __lhs,
     ^~~~~~~~
/usr/include/c++/8/bits/stl_iterator.h:899:5: note:   template argument deduction/substitution failed:
In file included from /usr/include/c++/8/bits/stl_algobase.h:71,
                 from /usr/include/c++/8/bits/char_traits.h:39,
                 from /usr/include/c++/8/ios:40,
                 from /usr/include/c++/8/istream:38,
                 from /usr/include/c++/8/sstream:38,
                 from /usr/include/c++/8/complex:45,
                 from /usr/include/c++/8/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/8/bits/stdc++.h:52,
                 from prog.cpp:1:
/usr/include/c++/8/bits/predefined_ops.h:43:23: note:   ‘querie’ is not derived from ‘const __gnu_cxx::__normal_iterator<_Iterator, _Container>’
       { return *__it1 < *__it2; }
                ~~~~~~~^~~~~~~~
/usr/include/c++/8/bits/predefined_ops.h: In instantiation of ‘bool __gnu_cxx::__ops::_Iter_less_val::operator()(_Iterator, _Value&) const [with _Iterator = querie*; _Value = querie]’:
/usr/include/c++/8/bits/stl_heap.h:133:48:   required from ‘void std::__push_heap(_RandomAccessIterator, _Distance, _Distance, _Tp, _Compare&) [with _RandomAccessIterator = querie*; _Distance = long int; _Tp = querie; _Compare = __gnu_cxx::__ops::_Iter_less_val]’
/usr/include/c++/8/bits/stl_heap.h:237:23:   required from ‘void std::__adjust_heap(_RandomAccessIterator, _Distance, _Distance, _Tp, _Compare) [with _RandomAccessIterator = querie*; _Distance = long int; _Tp = querie; _Compare = __gnu_cxx::__ops::_Iter_less_iter]’
/usr/include/c++/8/bits/stl_heap.h:342:22:   required from ‘void std::__make_heap(_RandomAccessIterator, _RandomAccessIterator, _Compare&) [with _RandomAccessIterator = querie*; _Compare = __gnu_cxx::__ops::_Iter_less_iter]’
/usr/include/c++/8/bits/stl_algo.h:1672:23:   required from ‘void std::__heap_select(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = querie*; _Compare = __gnu_cxx::__ops::_Iter_less_iter]’
/usr/include/c++/8/bits/stl_algo.h:1933:25:   required from ‘void std::__partial_sort(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = querie*; _Compare = __gnu_cxx::__ops::_Iter_less_iter]’
/usr/include/c++/8/bits/stl_algo.h:1948:27:   required from ‘void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator = querie*; _Size = long int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]’
/usr/include/c++/8/bits/stl_algo.h:1968:25:   required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = querie*; _Compare = __gnu_cxx::__ops::_Iter_less_iter]’
/usr/include/c++/8/bits/stl_algo.h:4834:18:   required from ‘void std::sort(_RAIter, _RAIter) [with _RAIter = querie*]’
prog.cpp:18:15:   required from here
/usr/include/c++/8/bits/predefined_ops.h:65:22: error: no match for ‘operator<’ (operand types are ‘querie’ and ‘querie’)
       { return *__it < __val; }
                ~~~~~~^~~~~~~
In file included from /usr/include/c++/8/bits/stl_algobase.h:67,
                 from /usr/include/c++/8/bits/char_traits.h:39,
                 from /usr/include/c++/8/ios:40,
                 from /usr/include/c++/8/istream:38,
                 from /usr/include/c++/8/sstream:38,
                 from /usr/include/c++/8/complex:45,
                 from /usr/include/c++/8/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/8/bits/stdc++.h:52,
                 from prog.cpp:1:
/usr/include/c++/8/bits/stl_iterator.h:892:5: note: candidate: ‘template<class _IteratorL, class _IteratorR, class _Container> bool __gnu_cxx::operator<(const __gnu_cxx::__normal_iterator<_IteratorL, _Container>&, const __gnu_cxx::__normal_iterator<_IteratorR, _Container>&)’
     operator<(const __normal_iterator<_IteratorL, _Container>& __lhs,
     ^~~~~~~~
/usr/include/c++/8/bits/stl_iterator.h:892:5: note:   template argument deduction/substitution failed:
In file included from /usr/include/c++/8/bits/stl_algobase.h:71,
                 from /usr/include/c++/8/bits/char_traits.h:39,
                 from /usr/include/c++/8/ios:40,
                 from /usr/include/c++/8/istream:38,
                 from /usr/include/c++/8/sstream:38,
                 from /usr/include/c++/8/complex:45,
                 from /usr/include/c++/8/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/8/bits/stdc++.h:52,
                 from prog.cpp:1:
/usr/include/c++/8/bits/predefined_ops.h:65:22: note:   ‘querie’ is not derived from ‘const __gnu_cxx::__normal_iterator<_IteratorL, _Container>’
       { return *__it < __val; }
                ~~~~~~^~~~~~~
In file included from /usr/include/c++/8/bits/stl_algobase.h:67,
                 from /usr/include/c++/8/bits/char_traits.h:39,
                 from /usr/include/c++/8/ios:40,
                 from /usr/include/c++/8/istream:38,
                 from /usr/include/c++/8/sstream:38,
                 from /usr/include/c++/8/complex:45,
                 from /usr/include/c++/8/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/8/bits/stdc++.h:52,
                 from prog.cpp:1:
/usr/include/c++/8/bits/stl_iterator.h:899:5: note: candidate: ‘template<class _Iterator, class _Container> bool __gnu_cxx::operator<(const __gnu_cxx::__normal_iterator<_Iterator, _Container>&, const __gnu_cxx::__normal_iterator<_Iterator, _Container>&)’
     operator<(const __normal_iterator<_Iterator, _Container>& __lhs,
     ^~~~~~~~
/usr/include/c++/8/bits/stl_iterator.h:899:5: note:   template argument deduction/substitution failed:
In file included from /usr/include/c++/8/bits/stl_algobase.h:71,
                 from /usr/include/c++/8/bits/char_traits.h:39,
                 from /usr/include/c++/8/ios:40,
                 from /usr/include/c++/8/istream:38,
                 from /usr/include/c++/8/sstream:38,
                 from /usr/include/c++/8/complex:45,
                 from /usr/include/c++/8/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/8/bits/stdc++.h:52,
                 from prog.cpp:1:
/usr/include/c++/8/bits/predefined_ops.h:65:22: note:   ‘querie’ is not derived from ‘const __gnu_cxx::__normal_iterator<_Iterator, _Container>’
       { return *__it < __val; }
                ~~~~~~^~~~~~~
stdout
Standard output is empty