#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 | #57497259 | Utilizator | |
Fișier | pozmax.cpp | Dimensiune | 803 B |
Data încărcării | 02 Aprilie 2025, 12:49 | Scor / rezultat | 0 puncte |
pozmax.cpp: In function 'void citire(long long int*, long long int&, FILE*)': pozmax.cpp:7:28: warning: format '%f' expects argument of type 'float*', but argument 3 has type 'long long int*' [-Wformat=] fscanf(f,"%f",&v[i]); ^ pozmax.cpp: In function 'int main()': pozmax.cpp:41:51: warning: format '%lld' expects argument of type 'long long int', but argument 3 has type 'int' [-Wformat=] fprintf(g,"%lld %lld",primMax(v,n),ultMax(v,n)); ^ pozmax.cpp:41:51: warning: format '%lld' expects argument of type 'long long int', but argument 4 has type 'int' [-Wformat=] pozmax.cpp: In function 'void citire(long long int*, long long int&, FILE*)': 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(long long int*, long long int)': pozmax.cpp:24:1: warning: control reaches end of non-void function [-Wreturn-type] } ^ pozmax.cpp: In function 'int ultMax(long long int*, long long 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 | Raspuns gresit. | 20 | 0 | Exemplu | |
2 | 0 secunde | Raspuns gresit. | 40 | 0 | ||
3 | 0 secunde | Caught fatal signal 11 | 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ă.