Borderou de evaluare (job #3266841)
Utilizator | Data | 10 ianuarie 2025 17:27:54 | |
---|---|---|---|
Problema | Secvente | Status | done |
Runda | Arhiva de probleme | Compilator | cpp-64 | Vezi sursa |
Scor | 0 |
Raport evaluator
Eroare de compilare:
main.cpp: In function 'int longest(const std::vector<int>&)':
main.cpp:8:10: error: assignment of read-only location '(& a)->std::vector<int>::operator[](0)'
8 | a[0] = -1; // IniÈializÄm suma 0 la poziÈia -1 (pentru a acoperi cazul când prima sumÄ este divizibilÄ cu 3)
main.cpp:10:27: error: invalid use of member function 'constexpr std::vector<_Tp, _Alloc>::size_type std::vector<_Tp, _Alloc>::size() const [with _Tp = int; _Alloc = std::allocator<int>; size_type = long unsigned int]' (did you forget the '()' ?)
10 | for (int i = 0; i < a.size; i++) {
| ~~^~~~
| ()
main.cpp:21:18: error: assignment of read-only location '(& a)->std::vector<int>::operator[](((std::vector<int>::size_type)r))'
21 | a[r] = i; // SalvÄm prima apariÈie a acestei rÄmÄÈiÈe
main.cpp: In function 'int main()':
main.cpp:33:17: error: conflicting declaration 'std::vector<int> a1'
33 | vector<int> a1(N1);
| ^~
main.cpp:29:20: note: previous declaration as 'int a1 [500000]'
29 | int N1, N2, N3,a1[500000];
| ^~
main.cpp:53:21: error: invalid initialization of reference of type 'const std::vector<int>&' from expression of type 'int [500000]'
53 | cout << longest(a1) << endl;
| ^~
main.cpp:3:32: note: in passing argument 1 of 'int longest(const std::vector<int>&)'
3 | int longest(const vector<int>& a) {
| ~~~~~~~~~~~~~~~~~~~^
Non zero exit status: 1
Ceva nu functioneaza?
- Citeste despre borderoul de evaluare.
- Daca tot nu e bine, contacteaza-ne pe forum !