Borderou de evaluare (job #3376560)
| Utilizator | Data | 18 noiembrie 2026 12:08:56 | |
|---|---|---|---|
| Problema | Diff | Status | done |
| Runda | Arhiva de probleme | Compilator | cpp-64 | Vezi sursa |
| Scor | 0 | ||
Raport evaluator
Eroare de compilare:
main.cpp: In function 'int main()':
main.cpp:11:36: error: no match for 'operator=' (operand types are 'std::pair<int, int>' and 'std::pair<int, int>*')
11 | ans = new pair<int, int>[200005];
| ^
In file included from /usr/include/c++/12.2.1/bits/stl_algobase.h:64,
from /usr/include/c++/12.2.1/bits/specfun.h:45,
from /usr/include/c++/12.2.1/cmath:1935,
from /usr/include/c++/12.2.1/x86_64-pc-linux-gnu/bits/stdc++.h:41,
from main.cpp:1:
/usr/include/c++/12.2.1/bits/stl_pair.h:353:9: note: candidate: 'template<class _U1, class _U2> constexpr std::pair<_T1, _T2>& std::pair<_T1, _T2>::operator=(const std::pair<_U1, _U2>&) requires _S_assignable<const _U1&, const _U2&>() [with _U2 = _U1; _T1 = int; _T2 = int]'
353 | operator=(const pair<_U1, _U2>& __p)
| ^~~~~~~~
/usr/include/c++/12.2.1/bits/stl_pair.h:353:9: note: template argument deduction/substitution failed:
main.cpp:11:36: note: mismatched types 'const std::pair<_T1, _T2>' and 'std::pair<int, int>*'
11 | ans = new pair<int, int>[200005];
| ^
/usr/include/c++/12.2.1/bits/stl_pair.h:365:9: note: candidate: 'template<class _U1, class _U2> constexpr std::pair<_T1, _T2>& std::pair<_T1, _T2>::operator=(std::pair<_U1, _U2>&&) requires _S_assignable<_U1, _U2>() [with _U2 = _U1; _T1 = int; _T2 = int]'
365 | operator=(pair<_U1, _U2>&& __p)
| ^~~~~~~~
/usr/include/c++/12.2.1/bits/stl_pair.h:365:9: note: template argument deduction/substitution failed:
main.cpp:11:36: note: mismatched types 'std::pair<_T1, _T2>' and 'std::pair<int, int>*'
11 | ans = new pair<int, int>[200005];
| ^
/usr/include/c++/12.2.1/bits/stl_pair.h:330:7: note: candidate: 'constexpr std::pair<_T1, _T2>& std::pair<_T1, _T2>::operator=(const std::pair<_T1, _T2>&) requires _S_assignable<const _T1&, const _T2&>() [with _T1 = int; _T2 = int]'
330 | operator=(const pair& __p)
| ^~~~~~~~
/usr/include/c++/12.2.1/bits/stl_pair.h:330:29: note: no known conversion for argument 1 from 'std::pair<int, int>*' to 'const std::pair<int, int>&'
330 | operator=(const pair& __p)
| ~~~~~~~~~~~~^~~
/usr/include/c++/12.2.1/bits/stl_pair.h:341:7: note: candidate: 'constexpr std::pair<_T1, _T2>& std::pair<_T1, _T2>::operator=(std::pair<_T1, _T2>&&) requires _S_assignable<_T1, _T2>() [with _T1 = int; _T2 = int]'
341 | operator=(pair&& __p)
| ^~~~~~~~
/usr/include/c++/12.2.1/bits/stl_pair.h:341:24: note: no known conversion for argument 1 from 'std::pair<int, int>*' to 'std::pair<int, int>&&'
341 | operator=(pair&& __p)
| ~~~~~~~^~~
main.cpp:12:9: error: no match for 'operator+=' (operand types are 'std::pair<int, int>' and 'int')
12 | ans += 100000;
| ~~~~^~~~~~~~~
main.cpp:26:12: error: no match for 'operator[]' (operand types are 'std::pair<int, int>' and 'int')
26 | ans[s - mini] = { lastmin + 1, i };
| ^
main.cpp:27:12: error: no match for 'operator[]' (operand types are 'std::pair<int, int>' and 'int')
27 | ans[s - maxi] = { lastmax + 1, i };
| ^
main.cpp:40:35: error: no match for 'operator[]' (operand types are 'std::pair<int, int>' and 'int')
40 | if( x < -n || x > n || ans[x].first == 0 ) {
| ^
main.cpp:44:24: error: no match for 'operator[]' (operand types are 'std::pair<int, int>' and 'int')
44 | cout << ans[x].first << ' ' << ans[x].second << '\n';
| ^
Non zero exit status: 1
Ceva nu functioneaza?
- Citeste despre borderoul de evaluare.
- Daca tot nu e bine, contacteaza-ne pe forum !
