#297
SecvSumMax
Se dă un şir cu n
elemente, numere întregi. Determinaţi secvenţa de elemente cu suma maximă.
Problema | SecvSumMax | Operații I/O |
secvsummax.in /secvsummax.out
|
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #54764357 | Utilizator | |
Fișier | secvsummax.cpp | Dimensiune | 979 B |
Data încărcării | 07 Decembrie 2024, 21:03 | Scor / rezultat | Eroare de compilare |
secvsummax.cpp:1:2: error: invalid preprocessing directive #Include #Include <bits/stdc++.h> ^ secvsummax.cpp: In function 'int main()': secvsummax.cpp:5:5: error: 'ifstream' was not declared in this scope ifstream fin("secvsummax.in"); ^ secvsummax.cpp:5:14: error: expected ';' before 'fin' ifstream fin("secvsummax.in"); ^ secvsummax.cpp:6:5: error: 'ofstream' was not declared in this scope ofstream fout("secvsummax.out"); ^ secvsummax.cpp:6:14: error: expected ';' before 'fout' ofstream fout("secvsummax.out"); ^ secvsummax.cpp:9:5: error: 'fin' was not declared in this scope fin >> n; ^ secvsummax.cpp:10:5: error: 'vector' was not declared in this scope vector<int> arr(n); ^ secvsummax.cpp:10:12: error: expected primary-expression before 'int' vector<int> arr(n); ^ secvsummax.cpp:10:12: error: expected ';' before 'int' secvsummax.cpp:13:16: error: 'arr' was not declared in this scope fin >> arr[i]; ^ secvsummax.cpp:17:19: error: 'INT_MIN' was not declared in this scope int max_sum = INT_MIN; // Suma maxima gasita ^ secvsummax.cpp:22:24: error: 'arr' was not declared in this scope current_sum += arr[i]; ^ secvsummax.cpp:37:5: error: 'fout' was not declared in this scope fout << start + 1 << " " << end + 1 << endl; ^ secvsummax.cpp:37:44: error: 'endl' was not declared in this scope fout << start + 1 << " " << end + 1 << endl; ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema SecvSumMax face parte din prima categorie. Soluția propusă de tine va fi evaluată astfel:
Suma punctajelor acordate pe testele utilizate pentru verificare este 100. Astfel, soluția ta poate obține cel mult 100 de puncte, caz în care se poate considera corectă.