#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 | #38162841 | Utilizator | |
Fișier | expr_max.cpp | Dimensiune | 2.44 KB |
Data încărcării | 01 Octombrie 2022, 21:35 | Scor / rezultat | 70 puncte |
expr_max.cpp: In function 'int constr_nr(int&)': expr_max.cpp:12: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:23:29: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for(int i=0; i<sir.size(); i++) ^ expr_max.cpp:34:29: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for(int i=0; i<val.size(); i++) ^ expr_max.cpp:35:33: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for(int j=0; j<val.size(); j++) ^ expr_max.cpp:37:25: warning: overflow in implicit constant conversion [-Woverflow] dp_min[i][j]=(1LL<<62); ^ expr_max.cpp:38:25: warning: overflow in implicit constant conversion [-Woverflow] dp_max[i][j]=-(1LL<<62); ^ expr_max.cpp:42:36: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for(int lung=1; lung<=val.size(); lung++) ^ expr_max.cpp:44:42: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for(int st=0; st<val.size()-lung+1; st++) ^ expr_max.cpp:50:30: warning: 'd' may be used uninitialized in this function [-Wmaybe-uninitialized] int a, b, c, d; ^ expr_max.cpp:50:27: warning: 'c' may be used uninitialized in this function [-Wmaybe-uninitialized] int a, b, c, d; ^ expr_max.cpp:50:24: warning: 'b' may be used uninitialized in this function [-Wmaybe-uninitialized] int a, b, c, d; ^ expr_max.cpp:50: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ă.