Borderou de evaluare (job #2899246)
Utilizator | Data | 8 mai 2022 12:51:04 | |
---|---|---|---|
Problema | Plagiat | Status | done |
Runda | Arhiva de probleme | Compilator | cpp-64 | Vezi sursa |
Scor | 0 |
Raport evaluator
Eroare de compilare:
main.cpp:10:19: error: wrong number of template arguments (1, should be 2)
10 | pair <int i, int j> v[401];
| ^
In file included from /usr/include/c++/10/bits/stl_algobase.h:64,
from /usr/include/c++/10/bits/char_traits.h:39,
from /usr/include/c++/10/ios:40,
from /usr/include/c++/10/istream:38,
from /usr/include/c++/10/fstream:38,
from main.cpp:1:
/usr/include/c++/10/bits/stl_pair.h:211:12: note: provided for 'template<class _T1, class _T2> struct std::pair'
211 | struct pair
| ^~~~
main.cpp: In function 'int main()':
main.cpp:21:13: error: 'i' was not declared in this scope
21 | for(i=1;i<=n;i++)
| ^
main.cpp:24:13: error: 'i' was not declared in this scope
24 | for(i=1;i<n;i++)
| ^
main.cpp:26:17: error: 'j' was not declared in this scope
26 | for(j=i+1;j<=n;j++)
| ^
main.cpp:28:17: error: 'd1' was not declared in this scope; did you mean 'y1'?
28 | d1=abs(v[j].first-v[i].first);
| ^~
| y1
main.cpp:29:17: error: 'd2' was not declared in this scope
29 | d2=abs(v[j].second-v[i].second);
| ^~
main.cpp:30:19: error: no match for 'operator[]' (operand types are 'std::map<std::pair<int, int>, int>' and '<brace-enclosed initializer list>')
30 | mf[{d1,d2}]++;
| ^
In file included from /usr/include/c++/10/map:61,
from main.cpp:2:
/usr/include/c++/10/bits/stl_map.h:492:7: note: candidate: 'std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type& std::map<_Key, _Tp, _Compare, _Alloc>::operator[](const key_type&) [with _Key = std::pair<int, int>; _Tp = int; _Compare = std::less<std::pair<int, int> >; _Alloc = std::allocator<std::pair<const std::pair<int, int>, int> >; std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type = int; std::map<_Key, _Tp, _Compare, _Alloc>::key_type = std::pair<int, int>]'
492 | operator[](const key_type& __k)
| ^~~~~~~~
/usr/include/c++/10/bits/stl_map.h:492:34: note: no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'const key_type&' {aka 'const std::pair<int, int>&'}
492 | operator[](const key_type& __k)
| ~~~~~~~~~~~~~~~~^~~
/usr/include/c++/10/bits/stl_map.h:512:7: note: candidate: 'std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type& std::map<_Key, _Tp, _Compare, _Alloc>::operator[](std::map<_Key, _Tp, _Compare, _Alloc>::key_type&&) [with _Key = std::pair<int, int>; _Tp = int; _Compare = std::less<std::pair<int, int> >; _Alloc = std::allocator<std::pair<const std::pair<int, int>, int> >; std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type = int; std::map<_Key, _Tp, _Compare, _Alloc>::key_type = std::pair<int, int>]'
512 | operator[](key_type&& __k)
| ^~~~~~~~
/usr/include/c++/10/bits/stl_map.h:512:29: note: no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'std::map<std::pair<int, int>, int>::key_type&&' {aka 'std::pair<int, int>&&'}
512 | operator[](key_type&& __k)
| ~~~~~~~~~~~^~~
main.cpp:31:22: error: no match for 'operator[]' (operand types are 'std::map<std::pair<int, int>, int>' and '<brace-enclosed initializer list>')
31 | if(mf[{d1,d2}]==2)
| ^
In file included from /usr/include/c++/10/map:61,
Non zero exit status: 1
Ceva nu functioneaza?
- Citeste despre borderoul de evaluare.
- Daca tot nu e bine, contacteaza-ne pe forum !