#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 | #64475891 | Utilizator | |
| Fișier | pozmax.cpp | Dimensiune | 464 B |
| Data încărcării | 09 Mai 2026, 14:00 | Scor/rezultat | 0 puncte |
pozmax.cpp: In function ‘int main()’: pozmax.cpp:17:9: warning: ‘max1’ may be used uninitialized [-Wmaybe-uninitialized] 17 | if(x>max1) | ^~ pozmax.cpp:11:14: note: ‘max1’ was declared here 11 | float x, max1; | ^~~~ pozmax.cpp:26:17: warning: ‘pozmin’ may be used uninitialized [-Wmaybe-uninitialized] 26 | f2<<pozmin<<' '<<pozmax; | ^~~ pozmax.cpp:10:15: note: ‘pozmin’ was declared here 10 | int n, i, pozmin, pozmax; | ^~~~~~ pozmax.cpp:26:22: warning: ‘pozmax’ may be used uninitialized [-Wmaybe-uninitialized] 26 | f2<<pozmin<<' '<<pozmax; | ^~~~~~ pozmax.cpp:10:23: note: ‘pozmax’ was declared here 10 | int n, i, pozmin, pozmax; | ^~~~~~
| Test | Timp | Mesaj evaluare | Scor posibil | Scor obținut | ||
|---|---|---|---|---|---|---|
| 1 | 0.001 secunde | Raspuns gresit. | 20 | 0 | Exemplu | |
| 2 | 0.002 secunde | Raspuns gresit. | 40 | 0 | ||
| 3 | 0.038 secunde | Raspuns gresit. | 40 | 0 | ||
| Punctaj total | 0 | |||||
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ă.