# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1162355 | tsengang | Detecting Molecules (IOI16_molecules) | C++20 | 컴파일 에러 | 0 ms | 0 KiB |
#include <bits/stdc++.h>
#include "molecules.h"
using namespace std;
#define ll long long
#define ff first
#define ss second
#define all(x) (x).begin(), (x).end()
#define pb push_back
#define ertunt return
const int mod = 998244353;
#pragma GCC target ("avx2")
#pragma GCC optimization ("O3")
#pragma GCC optimization ("unroll-loops")
vector<int>find_subset(int l, int u, vector<int>w){
int n = w.size();
pair<int,int>p(n);
for(int i = 0 ; i < n; i++){
p[i].ss = i;
p[i].ff = w[i];
}
sort(all(p));
ll cur = 0;
vector<int> ans;
ll j = 0;
while(j < n and cur + p[j].ff <= u){
cur+=p[j].ff;
j++;
}
if(j == 0)ertunt ans;
if(cur >= l){
for(int i = 0 ; i < j; i++)ans.pb(p[i].ss);
ertunt ans;
}
int lst = n-1;
int i = 0;
while(lst >= j){
if(cur >= l)break;
cur+= p[lst].ff - p[i].ff;
ans.pb(p[lst].ss);
i++;
lst--;
}
if(cur >= l){
for(; i < j; i++)ans.pb(p[i].ss);
ertunt ans;
}
else{
vector<int>c;
ertunt c;
}
}
컴파일 시 표준 에러 (stderr) 메시지
molecules.cpp: In function 'std::vector<int> find_subset(int, int, std::vector<int>)': molecules.cpp:16:21: error: no matching function for call to 'std::pair<int, int>::pair(int&)' 16 | pair<int,int>p(n); | ^ In file included from /usr/include/c++/11/bits/stl_algobase.h:64, 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 molecules.cpp:1: /usr/include/c++/11/bits/stl_pair.h:452:9: note: candidate: 'template<class ... _Args1, long unsigned int ..._Indexes1, class ... _Args2, long unsigned int ..._Indexes2> constexpr std::pair<_T1, _T2>::pair(std::tuple<_Args1 ...>&, std::tuple<_Args2 ...>&, std::_Index_tuple<_Indexes1 ...>, std::_Index_tuple<_Indexes2 ...>) [with _Args1 = {_Args1 ...}; long unsigned int ..._Indexes1 = {_Indexes1 ...}; _Args2 = {_Args2 ...}; long unsigned int ..._Indexes2 = {_Indexes2 ...}; _T1 = int; _T2 = int]' 452 | pair(tuple<_Args1...>&, tuple<_Args2...>&, | ^~~~ /usr/include/c++/11/bits/stl_pair.h:452:9: note: template argument deduction/substitution failed: molecules.cpp:16:21: note: mismatched types 'std::tuple<_Tps ...>' and 'int' 16 | pair<int,int>p(n); | ^ In file included from /usr/include/c++/11/bits/stl_algobase.h:64, 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 molecules.cpp:1: /usr/include/c++/11/bits/stl_pair.h:387:9: note: candidate: 'template<class ... _Args1, class ... _Args2> constexpr std::pair<_T1, _T2>::pair(std::piecewise_construct_t, std::tuple<_Args1 ...>, std::tuple<_Args2 ...>) [with _Args1 = {_Args1 ...}; _Args2 = {_Args2 ...}; _T1 = int; _T2 = int]' 387 | pair(piecewise_construct_t, tuple<_Args1...>, tuple<_Args2...>); | ^~~~ /usr/include/c++/11/bits/stl_pair.h:387:9: note: template argument deduction/substitution failed: molecules.cpp:16:21: note: candidate expects 3 arguments, 1 provided 16 | pair<int,int>p(n); | ^ In file included from /usr/include/c++/11/bits/stl_algobase.h:64, 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 molecules.cpp:1: /usr/include/c++/11/bits/stl_pair.h:381:28: note: candidate: 'template<class _U1, class _U2, typename std::enable_if<(std::_PCC<((! std::is_same<int, _U1>::value) || (! std::is_same<int, _U2>::value)), int, int>::_MoveConstructiblePair<_U1, _U2>() && (! std::_PCC<((! std::is_same<int, _U1>::value) || (! std::is_same<int, _U2>::value)), int, int>::_ImplicitlyMoveConvertiblePair<_U1, _U2>())), bool>::type <anonymous> > constexpr std::pair<_T1, _T2>::pair(std::pair<_U1, _U2>&&) [with _U1 = _U1; _U2 = _U2; typename std::enable_if<(std::_PCC<((! std::is_same<_T1, _U1>::value) || (! std::is_same<_T2, _U2>::value)), _T1, _T2>::_MoveConstructiblePair<_U1, _U2>() && (! std::_PCC<((! std::is_same<_T1, _U1>::value) || (! std::is_same<_T2, _U2>::value)), _T1, _T2>::_ImplicitlyMoveConvertiblePair<_U1, _U2>())), bool>::type <anonymous> = <anonymous>; _T1 = int; _T2 = int]' 381 | explicit constexpr pair(pair<_U1, _U2>&& __p) | ^~~~ /usr/include/c++/11/bits/stl_pair.h:381:28: note: template argument deduction/substitution failed: molecules.cpp:16:21: note: mismatched types 'std::pair<_T1, _T2>' and 'int' 16 | pair<int,int>p(n); | ^ In file included from /usr/include/c++/11/bits/stl_algobase.h:64, 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 molecules.cpp:1: /usr/include/c++/11/bits/stl_pair.h:371:19: note: candidate: 'template<class _U1, class _U2, typename std::enable_if<(std::_PCC<((! std::is_same<int, _U1>::value) || (! std::is_same<int, _U2>::value)), int, int>::_MoveConstructiblePair<_U1, _U2>() && std::_PCC<((! std::is_same<int, _U1>::value) || (! std::is_same<int, _U2>::value)), int, int>::_ImplicitlyMoveConvertiblePair<_U1, _U2>()), bool>::type <anonymous> > constexpr std::pair<_T1, _T2>::pair(std::pair<_U1, _U2>&&) [with _U1 = _U1; _U2 = _U2; typename std::enable_if<(std::_PCC<((! std::is_same<_T1, _U1>::value) || (! std::is_same<_T2, _U2>::value)), _T1, _T2>::_MoveConstructiblePair<_U1, _U2>() && std::_PCC<((! std::is_same<_T1, _U1>::value) || (! std::is_same<_T2, _U2>::value)), _T1, _T2>::_ImplicitlyMoveConvertiblePair<_U1, _U2>()), bool>::type <anonymous> = <anonymous>; _T1 = int; _T2 = int]' 371 | constexpr pair(pair<_U1, _U2>&& __p) | ^~~~ /usr/include/c++/11/bits/stl_pair.h:371:19: note: template argument deduction/substitution failed: molecules.cpp:16:21: note: mismatched types 'std::pair<_T1, _T2>' and 'int' 16 | pair<int,int>p(n); | ^ In file included from /usr/include/c++/11/bits/stl_algobase.h:64, 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 molecules.cpp:1: /usr/include/c++/11/bits/stl_pair.h:361:28: note: candidate: 'template<class _U1, class _U2, typename std::enable_if<(_MoveConstructiblePair<_U1, _U2>() && (! _ImplicitlyMoveConvertiblePair<_U1, _U2>())), bool>::type <anonymous> > constexpr std::pair<_T1, _T2>::pair(_U1&&, _U2&&) [with _U1 = _U1; _U2 = _U2; typename std::enable_if<(std::_PCC<true, _T1, _T2>::_MoveConstructiblePair<_U1, _U2>() && (! std::_PCC<true, _T1, _T2>::_ImplicitlyMoveConvertiblePair<_U1, _U2>())), bool>::type <anonymous> = <anonymous>; _T1 = int; _T2 = int]' 361 | explicit constexpr pair(_U1&& __x, _U2&& __y) | ^~~~ /usr/include/c++/11/bits/stl_pair.h:361:28: note: template argument deduction/substitution failed: molecules.cpp:16:21: note: candidate expects 2 arguments, 1 provided 16 | pair<int,int>p(n); | ^ In file included from /usr/include/c++/11/bits/stl_algobase.h:64, 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 molecules.cpp:1: /usr/include/c++/11/bits/stl_pair.h:352:19: note: candidate: 'template<class _U1, class _U2, typename std::enable_if<(_MoveConstructiblePair<_U1, _U2>() && _ImplicitlyMoveConvertiblePair<_U1, _U2>()), bool>::type <anonymous> > constexpr std::pair<_T1, _T2>::pair(_U1&&, _U2&&) [with _U1 = _U1; _U2 = _U2; typename std::enable_if<(std::_PCC<true, _T1, _T2>::_MoveConstructiblePair<_U1, _U2>() && std::_PCC<true, _T1, _T2>::_ImplicitlyMoveConvertiblePair<_U1, _U2>()), bool>::type <anonymous> = <anonymous>; _T1 = int; _T2 = int]' 352 | constexpr pair(_U1&& __x, _U2&& __y) | ^~~~ /usr/include/c++/11/bits/stl_pair.h:352:19: note: template argument deduction/substitution failed: molecules.cpp:16:21: note: candidate expects 2 arguments, 1 provided 16 | pair<int,int>p(n); | ^ In file included from /usr/include/c++/11/bits/stl_algobase.h:64, 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 molecules.cpp:1: /usr/include/c++/11/bits/stl_pair.h:343:17: note: candidate: 'template<class _U2, typename std::enable_if<_CopyMovePair<false, int, _U2>(), bool>::type <anonymous> > std::pair<_T1, _T2>::pair(const _T1&, _U2&&) [with _U2 = _U2; typename std::enable_if<std::_PCC<true, _T1, _T2>::_CopyMovePair<false, _T1, _U2>(), bool>::type <anonymous> = <anonymous>; _T1 = int; _T2 = int]' 343 | explicit pair(const _T1& __x, _U2&& __y) | ^~~~ /usr/include/c++/11/bits/stl_pair.h:343:17: note: template argument deduction/substitution failed: molecules.cpp:16:21: note: candidate expects 2 arguments, 1 provided 16 | pair<int,int>p(n); | ^ In file included from /usr/include/c++/11/bits/stl_algobase.h:64, 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 molecules.cpp:1: /usr/include/c++/11/bits/stl_pair.h:336:18: note: candidate: 'template<class _U2, typename std::enable_if<_CopyMovePair<true, int, _U2>(), bool>::type <anonymous> > constexpr std::pair<_T1, _T2>::pair(const _T1&, _U2&&) [with _U2 = _U2; typename std::enable_if<std::_PCC<true, _T1, _T2>::_CopyMovePair<true, _T1, _U2>(), bool>::type <anonymous> = <anonymous>; _T1 = int; _T2 = int]' 336 | constexpr pair(const _T1& __x, _U2&& __y) | ^~~~ /usr/include/c++/11/bits/stl_pair.h:336:18: note: template argument deduction/substitution failed: molecules.cpp:16:21: note: candidate expects 2 arguments, 1 provided 16 | pair<int,int>p(n); | ^ In file included from /usr/include/c++/11/bits/stl_algobase.h:64, 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 molecules.cpp:1: /usr/include/c++/11/bits/stl_pair.h:329:27: note: candidate: 'template<class _U1, typename std::enable_if<_MoveCopyPair<false, _U1, int>(), bool>::type <anonymous> > constexpr std::pair<_T1, _T2>::pair(_U1&&, const _T2&) [with _U1 = _U1; typename std::enable_if<std::_PCC<true, _T1, _T2>::_MoveCopyPair<false, _U1, _T2>(), bool>::type <anonymous> = <anonymous>; _T1 = int; _T2 = int]' 329 | explicit constexpr pair(_U1&& __x, const _T2& __y) | ^~~~ /usr/include/c++/11/bits/stl_pair.h:329:27: note: template argument deduction/substitution failed: molecules.cpp:16:21: note: candidate expects 2 arguments, 1 provided 16 | pair<int,int>p(n); | ^ In file included from /usr/include/c++/11/bits/stl_algobase.h:64, 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 molecules.cpp:1: /usr/include/c++/11/bits/stl_pair.h:322:18: note: candidate: 'template<class _U1, typename std::enable_if<_MoveCopyPair<true, _U1, int>(), bool>::type <anonymous> > constexpr std::pair<_T1, _T2>::pair(_U1&&, const _T2&) [with _U1 = _U1; typename std::enable_if<std::_PCC<true, _T1, _T2>::_MoveCopyPair<true, _U1, _T2>(), bool>::type <anonymous> = <anonymous>; _T1 = int; _T2 = int]' 322 | constexpr pair(_U1&& __x, const _T2& __y) | ^~~~ /usr/include/c++/11/bits/stl_pair.h:322:18: note: template argument deduction/substitution failed: molecules.cpp:16:21: note: candidate expects 2 arguments, 1 provided 16 | pair<int,int>p(n); | ^ In file included from /usr/include/c++/11/bits/stl_algobase.h:64, 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 molecules.cpp:1: /usr/include/c++/11/bits/stl_pair.h:309:28: note: candidate: 'template<class _U1, class _U2, typename std::enable_if<(std::_PCC<((! std::is_same<int, _U1>::value) || (! std::is_same<int, _U2>::value)), int, int>::_ConstructiblePair<_U1, _U2>() && (! std::_PCC<((! std::is_same<int, _U1>::value) || (! std::is_same<int, _U2>::value)), int, int>::_ImplicitlyConvertiblePair<_U1, _U2>())), bool>::type <anonymous> > constexpr std::pair<_T1, _T2>::pair(const std::pair<_U1, _U2>&) [with _U1 = _U1; _U2 = _U2; typename std::enable_if<(std::_PCC<((! std::is_same<_T1, _U1>::value) || (! std::is_same<_T2, _U2>::value)), _T1, _T2>::_ConstructiblePair<_U1, _U2>() && (! std::_PCC<((! std::is_same<_T1, _U1>::value) || (! std::is_same<_T2, _U2>::value)), _T1, _T2>::_ImplicitlyConvertiblePair<_U1, _U2>())), bool>::type <anonymous> = <anonymous>; _T1 = int; _T2 = int]' 309 | explicit constexpr pair(const pair<_U1, _U2>& __p) | ^~~~ /usr/include/c++/11/bits/stl_pair.h:309:28: note: template argument deduction/substitution failed: molecules.cpp:16:21: note: mismatched types 'const std::pair<_T1, _T2>' and 'int' 16 | pair<int,int>p(n); | ^ In file included from /usr/include/c++/11/bits/stl_algobase.h:64, 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 molecules.cpp:1: /usr/include/c++/11/bits/stl_pair.h:300:19: note: candidate: 'template<class _U1, class _U2, typename std::enable_if<(std::_PCC<((! std::is_same<int, _U1>::value) || (! std::is_same<int, _U2>::value)), int, int>::_ConstructiblePair<_U1, _U2>() && std::_PCC<((! std::is_same<int, _U1>::value) || (! std::is_same<int, _U2>::value)), int, int>::_ImplicitlyConvertiblePair<_U1, _U2>()), bool>::type <anonymous> > constexpr std::pair<_T1, _T2>::pair(const std::pair<_U1, _U2>&) [with _U1 = _U1; _U2 = _U2; typename std::enable_if<(std::_PCC<((! std::is_same<_T1, _U1>::value) || (! std::is_same<_T2, _U2>::value)), _T1, _T2>::_ConstructiblePair<_U1, _U2>() && std::_PCC<((! std::is_same<_T1, _U1>::value) || (! std::is_same<_T2, _U2>::value)), _T1, _T2>::_ImplicitlyConvertiblePair<_U1, _U2>()), bool>::type <anonymous> = <anonymous>; _T1 = int; _T2 = int]' 300 | constexpr pair(const pair<_U1, _U2>& __p) | ^~~~ /usr/include/c++/11/bits/stl_pair.h:300:19: note: template argument deduction/substitution failed: molecules.cpp:16:21: note: mismatched types 'const std::pair<_T1, _T2>' and 'int' 16 | pair<int,int>p(n); | ^ In file included from /usr/include/c++/11/bits/stl_algobase.h:64, 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 molecules.cpp:1: /usr/include/c++/11/bits/stl_pair.h:276:26: note: candidate: 'template<class _U1, class _U2, typename std::enable_if<(_ConstructiblePair<_U1, _U2>() && (! _ImplicitlyConvertiblePair<_U1, _U2>())), bool>::type <anonymous> > constexpr std::pair<_T1, _T2>::pair(const _T1&, const _T2&) [with _U1 = _U1; _U2 = _U2; typename std::enable_if<(std::_PCC<true, _T1, _T2>::_ConstructiblePair<_U1, _U2>() && (! std::_PCC<true, _T1, _T2>::_ImplicitlyConvertiblePair<_U1, _U2>())), bool>::type <anonymous> = <anonymous>; _T1 = int; _T2 = int]' 276 | explicit constexpr pair(const _T1& __a, const _T2& __b) | ^~~~ /usr/include/c++/11/bits/stl_pair.h:276:26: note: template argument deduction/substitution failed: molecules.cpp:16:21: note: candidate expects 2 arguments, 1 provided 16 | pair<int,int>p(n); | ^ In file included from /usr/include/c++/11/bits/stl_algobase.h:64, 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 molecules.cpp:1: /usr/include/c++/11/bits/stl_pair.h:266:17: note: candidate: 'template<class _U1, class _U2, typename std::enable_if<(_ConstructiblePair<_U1, _U2>() && _ImplicitlyConvertiblePair<_U1, _U2>()), bool>::type <anonymous> > constexpr std::pair<_T1, _T2>::pair(const _T1&, const _T2&) [with _U1 = _U1; _U2 = _U2; typename std::enable_if<(std::_PCC<true, _T1, _T2>::_ConstructiblePair<_U1, _U2>() && std::_PCC<true, _T1, _T2>::_ImplicitlyConvertiblePair<_U1, _U2>()), bool>::type <anonymous> = <anonymous>; _T1 = int; _T2 = int]' 266 | constexpr pair(const _T1& __a, const _T2& __b) | ^~~~ /usr/include/c++/11/bits/stl_pair.h:266:17: note: template argument deduction/substitution failed: molecules.cpp:16:21: note: candidate expects 2 arguments, 1 provided 16 | pair<int,int>p(n); | ^ In file included from /usr/include/c++/11/bits/stl_algobase.h:64, 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 molecules.cpp:1: /usr/include/c++/11/bits/stl_pair.h:245:26: note: candidate: 'template<class _U1, class _U2, typename std::enable_if<std::__and_<std::is_default_constructible<_U1>, std::is_default_constructible<_U2>, std::__not_<std::__and_<std::__is_implicitly_default_constructible<_U1>, std::__is_implicitly_default_constructible<_U2> > > >::value, bool>::type <anonymous> > constexpr std::pair<_T1, _T2>::pair() [with _U1 = _U1; _U2 = _U2; typename std::enable_if<std::__and_<std::is_default_constructible<_U1>, std::is_default_constructible<_U2>, std::__not_<std::__and_<std::__is_implicitly_default_constructible<_U1>, std::__is_implicitly_default_constructible<_U2> > > >::value, bool>::type <anonymous> = <anonymous>; _T1 = int; _T2 = int]' 245 | explicit constexpr pair() | ^~~~ /usr/include/c++/11/bits/stl_pair.h:245:26: note: template argument deduction/substitution failed: molecules.cpp:16:21: note: candidate expects 0 arguments, 1 provided 16 | pair<int,int>p(n); | ^ In file included from /usr/include/c++/11/bits/stl_algobase.h:64, 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 molecules.cpp:1: /usr/include/c++/11/bits/stl_pair.h:232:26: note: candidate: 'template<class _U1, class _U2, typename std::enable_if<std::__and_<std::__is_implicitly_default_constructible<_U1>, std::__is_implicitly_default_constructible<_U2> >::value, bool>::type <anonymous> > constexpr std::pair<_T1, _T2>::pair() [with _U1 = _U1; _U2 = _U2; typename std::enable_if<std::__and_<std::__is_implicitly_default_constructible<_U1>, std::__is_implicitly_default_constructible<_U2> >::value, bool>::type <anonymous> = <anonymous>; _T1 = int; _T2 = int]' 232 | _GLIBCXX_CONSTEXPR pair() | ^~~~ /usr/include/c++/11/bits/stl_pair.h:232:26: note: template argument deduction/substitution failed: molecules.cpp:16:21: note: candidate expects 0 arguments, 1 provided 16 | pair<int,int>p(n); | ^ In file included from /usr/include/c++/11/bits/stl_algobase.h:64, 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 molecules.cpp:1: /usr/include/c++/11/bits/stl_pair.h:315:17: note: candidate: 'constexpr std::pair<_T1, _T2>::pair(std::pair<_T1, _T2>&&) [with _T1 = int; _T2 = int]' 315 | constexpr pair(pair&&) = default; ///< Move constructor | ^~~~ /usr/include/c++/11/bits/stl_pair.h:315:22: note: no known conversion for argument 1 from 'int' to 'std::pair<int, int>&&' 315 | constexpr pair(pair&&) = default; ///< Move constructor | ^~~~~~ /usr/include/c++/11/bits/stl_pair.h:314:17: note: candidate: 'constexpr std::pair<_T1, _T2>::pair(const std::pair<_T1, _T2>&) [with _T1 = int; _T2 = int]' 314 | constexpr pair(const pair&) = default; ///< Copy constructor | ^~~~ /usr/include/c++/11/bits/stl_pair.h:314:22: note: no known conversion for argument 1 from 'int' to 'const std::pair<int, int>&' 314 | constexpr pair(const pair&) = default; ///< Copy constructor | ^~~~~~~~~~~ molecules.cpp:18:10: error: no match for 'operator[]' (operand types are 'std::pair<int, int>' and 'int') 18 | p[i].ss = i; | ^ molecules.cpp:19:10: error: no match for 'operator[]' (operand types are 'std::pair<int, int>' and 'int') 19 | p[i].ff = w[i]; | ^ molecules.cpp:7:20: error: 'struct std::pair<int, int>' has no member named 'begin' 7 | #define all(x) (x).begin(), (x).end() | ^~~~~ molecules.cpp:21:10: note: in expansion of macro 'all' 21 | sort(all(p)); | ^~~ molecules.cpp:7:33: error: 'struct std::pair<int, int>' has no member named 'end' 7 | #define all(x) (x).begin(), (x).end() | ^~~ molecules.cpp:21:10: note: in expansion of macro 'all' 21 | sort(all(p)); | ^~~ molecules.cpp:25:28: error: no match for 'operator[]' (operand types are 'std::pair<int, int>' and 'long long int') 25 | while(j < n and cur + p[j].ff <= u){ | ^ molecules.cpp:26:15: error: no match for 'operator[]' (operand types are 'std::pair<int, int>' and 'long long int') 26 | cur+=p[j].ff; | ^ molecules.cpp:31:44: error: no match for 'operator[]' (operand types are 'std::pair<int, int>' and 'int') 31 | for(int i = 0 ; i < j; i++)ans.pb(p[i].ss); | ^ molecules.cpp:38:16: error: no match for 'operator[]' (operand types are 'std::pair<int, int>' and 'int') 38 | cur+= p[lst].ff - p[i].ff; | ^ molecules.cpp:38:28: error: no match for 'operator[]' (operand types are 'std::pair<int, int>' and 'int') 38 | cur+= p[lst].ff - p[i].ff; | ^ molecules.cpp:39:17: error: no match for 'operator[]' (operand types are 'std::pair<int, int>' and 'int') 39 | ans.pb(p[lst].ss); | ^ molecules.cpp:44:34: error: no match for 'operator[]' (operand types are 'std::pair<int, int>' and 'int') 44 | for(; i < j; i++)ans.pb(p[i].ss); | ^ molecules.h:1:9: warning: #pragma once in main file 1 | #pragma once | ^~~~ molecules_c.h:1:9: warning: #pragma once in main file 1 | #pragma once | ^~~~