#998
Se consideră o matrice pătratică cu n linii şi n coloane şi elemente numere naturale. Să se modifice matricea în felul următor: toate elementele de pe liniile care conţin valoare maximă din matrice vor fi mărite cu valoarea minimă din matrice.
| Problema | Matrice6 | Operații I/O |
matrice6.in/matrice6.out
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64732447 | Utilizator | |
| Fișier | matrice6.cpp | Dimensiune | 1.16 KB |
| Data încărcării | 26 Mai 2026, 17:12 | Scor/rezultat | Eroare de compilare |
matrice6.cpp:4:1: error: ‘ifstream’ does not name a type 4 | ifstream fin("matrice6.in"); | ^~~~~~~~ matrice6.cpp:5:1: error: ‘ofstream’ does not name a type 5 | ofstream fout("matrice6.out"); | ^~~~~~~~ matrice6.cpp: In function ‘int main()’: matrice6.cpp:9:11: error: ‘fin’ was not declared in this scope 9 | if (!(fin >> n)) return 0; | ^~~ matrice6.cpp:11:5: error: ‘vector’ was not declared in this scope 11 | vector<vector<long long>> A(n, vector<long long>(n)); | ^~~~~~ matrice6.cpp:1:1: note: ‘std::vector’ is defined in header ‘<vector>’; did you forget to ‘#include <vector>’? +++ |+#include <vector> 1 | using namespace std; matrice6.cpp:11:19: error: expected primary-expression before ‘long’ 11 | vector<vector<long long>> A(n, vector<long long>(n)); | ^~~~ matrice6.cpp:14:12: error: expected primary-expression before ‘bool’ 14 | vector<bool> linieCuMaxim(n, false); | ^~~~ matrice6.cpp:21:13: error: ‘fin’ was not declared in this scope 21 | fin >> A[i][j]; | ^~~ matrice6.cpp:21:20: error: ‘A’ was not declared in this scope 21 | fin >> A[i][j]; | ^ matrice6.cpp:34:17: error: ‘A’ was not declared in this scope 34 | if (A[i][j] == valMax) { | ^ matrice6.cpp:35:17: error: ‘linieCuMaxim’ was not declared in this scope 35 | linieCuMaxim[i] = true; | ^~~~~~~~~~~~ matrice6.cpp:44:17: error: ‘linieCuMaxim’ was not declared in this scope 44 | if (linieCuMaxim[i]) { | ^~~~~~~~~~~~ matrice6.cpp:45:17: error: ‘A’ was not declared in this scope 45 | A[i][j] += valMin; | ^ matrice6.cpp:47:13: error: ‘fout’ was not declared in this scope 47 | fout << A[i][j]; | ^~~~ matrice6.cpp:47:21: error: ‘A’ was not declared in this scope 47 | fout << A[i][j]; | ^ matrice6.cpp:52:9: error: ‘fout’ was not declared in this scope 52 | fout << "\n"; | ^~~~ matrice6.cpp:55:14: error: expected ‘}’ at end of input 55 | return 0; | ^ matrice6.cpp:7:12: note: to match this ‘{’ 7 | int main() { | ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Matrice6 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ă.