#3674
Expr_max
Se consideră o expresie compusă din operatorii +
, -
, *
și cifre. La expresie se pot adăuga paranteze astfel încât valoarea calculată să fie maximă.
Problema | Expr_max | Operații I/O |
![]() |
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #38165956 | Utilizator | |
Fișier | expr_max.cpp | Dimensiune | 2.46 KB |
Data încărcării | 02 Octombrie 2022, 08:51 | Scor / rezultat | 70 puncte |
expr_max.cpp: In function 'int constr_nr(int&)': expr_max.cpp:13:22: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] while(i<sir.size() && sir[i]!='+' && sir[i]!='-' && sir[i]!='*') ^ expr_max.cpp: In function 'int main()': expr_max.cpp:24:29: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for(int i=0; i<sir.size(); i++) ^ expr_max.cpp:35:29: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for(int i=0; i<val.size(); i++) ^ expr_max.cpp:36:33: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for(int j=0; j<val.size(); j++) ^ expr_max.cpp:38:25: warning: overflow in implicit constant conversion [-Woverflow] dp_min[i][j]=E; ^ expr_max.cpp:39:25: warning: overflow in implicit constant conversion [-Woverflow] dp_max[i][j]=-E; ^ expr_max.cpp:43:36: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for(int lung=1; lung<=val.size(); lung++) ^ expr_max.cpp:45:42: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for(int st=0; st<val.size()-lung+1; st++) ^ expr_max.cpp:51:30: warning: 'd' may be used uninitialized in this function [-Wmaybe-uninitialized] int a, b, c, d; ^ expr_max.cpp:51:27: warning: 'c' may be used uninitialized in this function [-Wmaybe-uninitialized] int a, b, c, d; ^ expr_max.cpp:51:24: warning: 'b' may be used uninitialized in this function [-Wmaybe-uninitialized] int a, b, c, d; ^ expr_max.cpp:51:21: warning: 'a' may be used uninitialized in this function [-Wmaybe-uninitialized] int a, b, c, d; ^
Test | Timp | Mesaj evaluare | Scor posibil | Scor obținut | ||
---|---|---|---|---|---|---|
1 | 0 secunde | OK. | 20 | 20 | Exemplu | |
2 | 0 secunde | Raspuns gresit. | 20 | 0 | Exemplu | |
3 | 0 secunde | OK. | 20 | 20 | ||
4 | 0 secunde | OK. | 20 | 20 | ||
5 | 0 secunde | OK. | 10 | 10 | ||
6 | 0 secunde | Raspuns gresit. | 10 | 0 | ||
Punctaj total | 70 |
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Expr_max 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ă.