#282
Se dă un şir cu n elemente, numere reale, numerotate de la 1 la n. Determinaţi numărul de ordine al primei şi al ultimei apariţii a valorii maxime din şir.
| Problema | PozMax | Operații I/O |
pozmax.in/pozmax.out
|
|---|---|---|---|
| Limita timp | 0.2 secunde | Limita memorie |
Total: 32 MB
/
Stivă 8 MB
|
| Id soluție | #64794414 | Utilizator | |
| Fișier | pozmax.cpp | Dimensiune | 378 B |
| Data încărcării | 01 Iunie 2026, 19:36 | Scor/rezultat | 100 puncte |
In file included from /usr/include/c++/13/iostream:41, from pozmax.cpp:1: In member function ‘std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(float) [with _CharT = char; _Traits = std::char_traits<char>]’, inlined from ‘int main()’ at pozmax.cpp:19:11: /usr/include/c++/13/ostream:230:25: warning: ‘p’ may be used uninitialized [-Wmaybe-uninitialized] 230 | return _M_insert(static_cast<double>(__f)); | ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~ pozmax.cpp: In function ‘int main()’: pozmax.cpp:7:15: note: ‘p’ was declared here 7 | float n,x,p,u,m=-1000000000; | ^ In member function ‘std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(float) [with _CharT = char; _Traits = std::char_traits<char>]’, inlined from ‘int main()’ at pozmax.cpp:19:19: /usr/include/c++/13/ostream:230:25: warning: ‘u’ may be used uninitialized [-Wmaybe-uninitialized] 230 | return _M_insert(static_cast<double>(__f)); | ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~ pozmax.cpp: In function ‘int main()’: pozmax.cpp:7:17: note: ‘u’ was declared here 7 | float n,x,p,u,m=-1000000000; | ^
| Test | Timp | Mesaj evaluare | Scor posibil | Scor obținut | ||
|---|---|---|---|---|---|---|
| 1 | 0.001 secunde | OK. | 20 | 20 | Exemplu | |
| 2 | 0.001 secunde | OK. | 40 | 40 | ||
| 3 | 0.04 secunde | OK. | 40 | 40 | ||
| Punctaj total | 100 | |||||
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema PozMax 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ă.