#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 | #57497219 | Utilizator | |
Fișier | pozmax.cpp | Dimensiune | 745 B |
Data încărcării | 02 Aprilie 2025, 12:47 | Scor / rezultat | 60 puncte |
pozmax.cpp: In function 'void citire(int*, int&, FILE*)': pozmax.cpp:5:23: warning: format '%lld' expects argument of type 'long long int*', but argument 3 has type 'int*' [-Wformat=] fscanf(f,"%lld",&n); ^ pozmax.cpp:7:28: warning: format '%f' expects argument of type 'float*', but argument 3 has type 'int*' [-Wformat=] fscanf(f,"%f",&v[i]); ^ pozmax.cpp:5:24: warning: ignoring return value of 'int fscanf(FILE*, const char*, ...)', declared with attribute warn_unused_result [-Wunused-result] fscanf(f,"%lld",&n); ^ pozmax.cpp:7:29: warning: ignoring return value of 'int fscanf(FILE*, const char*, ...)', declared with attribute warn_unused_result [-Wunused-result] fscanf(f,"%f",&v[i]); ^ pozmax.cpp: In function 'int primMax(int*, int)': pozmax.cpp:24:1: warning: control reaches end of non-void function [-Wreturn-type] } ^ pozmax.cpp: In function 'int ultMax(int*, int)': pozmax.cpp:32:12: warning: 'i2' may be used uninitialized in this function [-Wmaybe-uninitialized] return i2; ^
Test | Timp | Mesaj evaluare | Scor posibil | Scor obținut | ||
---|---|---|---|---|---|---|
1 | 0 secunde | OK. | 20 | 20 | Exemplu | |
2 | 0 secunde | OK. | 40 | 40 | ||
3 | 0 secunde | Caught fatal signal 11 | 40 | 0 | ||
Punctaj total | 60 |
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ă.