#297
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 | #64652345 | Utilizator | |
| Fișier | secvsummax.cpp | Dimensiune | 466 B |
| Data încărcării | 20 Mai 2026, 16:33 | Scor/rezultat | 100 puncte |
In file included from /usr/include/c++/13/istream:41, from /usr/include/c++/13/fstream:40, from secvsummax.cpp:1: In member function ‘std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long int) [with _CharT = char; _Traits = std::char_traits<char>]’, inlined from ‘int main()’ at secvsummax.cpp:28:11: /usr/include/c++/13/ostream:204:25: warning: ‘p’ may be used uninitialized [-Wmaybe-uninitialized] 204 | { return _M_insert(__n); } | ~~~~~~~~~^~~~~ secvsummax.cpp: In function ‘int main()’: secvsummax.cpp:10:43: note: ‘p’ was declared here 10 | long long n, s=0, x, i, smax=-100000, p, u, pr=1; | ^ In member function ‘std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long int) [with _CharT = char; _Traits = std::char_traits<char>]’, inlined from ‘int main()’ at secvsummax.cpp:28:19: /usr/include/c++/13/ostream:204:25: warning: ‘u’ may be used uninitialized [-Wmaybe-uninitialized] 204 | { return _M_insert(__n); } | ~~~~~~~~~^~~~~ secvsummax.cpp: In function ‘int main()’: secvsummax.cpp:10:46: note: ‘u’ was declared here 10 | long long n, s=0, x, i, smax=-100000, p, u, pr=1; | ^
| Test | Timp | Mesaj evaluare | Scor posibil | Scor obținut | ||
|---|---|---|---|---|---|---|
| 1 | 0.001 secunde | OK. | 20 | 20 | Exemplu | |
| 2 | 0.001 secunde | OK. | 10 | 10 | ||
| 3 | 0.001 secunde | OK. | 20 | 20 | ||
| 4 | 0.003 secunde | OK. | 20 | 20 | ||
| 5 | 0.008 secunde | OK. | 20 | 20 | ||
| 6 | 0.001 secunde | OK. | 10 | 10 | ||
| Punctaj total | 100 | |||||
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ă.