#3165
MatrDivImp1
Se consideră o matrice cu m
linii și n
coloane, numere naturale. Folosind metoda Divide et Impera, determinați suma numerelor pare din matrice.
Problema | MatrDivImp1 | Operații I/O | tastatură/ecran |
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #50968344 | Utilizator | |
Fișier | matrdivimp1.cpp | Dimensiune | 671 B |
Data încărcării | 16 Mai 2024, 12:52 | Scor / rezultat | Eroare de compilare |
matrdivimp1.cpp:2:7: error: expected nested-name-specifier before 'namesapce' using namesapce std; ^ matrdivimp1.cpp:2:7: error: 'namesapce' has not been declared matrdivimp1.cpp:2:17: error: expected ';' before 'std' using namesapce std; ^ matrdivimp1.cpp:2:17: error: 'std' does not name a type matrdivimp1.cpp:3:48: error: 'intx2' has not been declared long long sum(int a[101][101], int x1, int y1, intx2, int y2) ^ matrdivimp1.cpp: In function 'long long int sum(int (*)[101], int, int, int, int)': matrdivimp1.cpp:5:8: error: 'x2' was not declared in this scope if(x2<=x1 || y2<=y1) ^ matrdivimp1.cpp:15:17: error: 'x2' was not declared in this scope int mj1=(x1+x2)/2, mj2=(y1+y2)/2; ^ matrdivimp1.cpp:16:28: error: 'mj2' was not declared in this scope return sum(a,x1,y1,mj1,mj2)+sum(a,mj1+1,y1,x2,mj2)+sum(a,x1, mj2+1,mj1,y2)+sum(a,mj1+1,mj2+1,x2,y2); ^ matrdivimp1.cpp: In function 'int main()': matrdivimp1.cpp:21:2: error: 'cin' was not declared in this scope cin>>n>>m; ^ matrdivimp1.cpp:21:2: note: suggested alternative: In file included from matrdivimp1.cpp:1:0: /usr/include/c++/4.8/iostream:60:18: note: 'std::cin' extern istream cin; /// Linked to standard input ^ matrdivimp1.cpp:27:3: error: 'cout' was not declared in this scope cout<<sum(a,0,0,n-1,m-1)<<'\n'; ^ matrdivimp1.cpp:27:3: note: suggested alternative: In file included from matrdivimp1.cpp:1:0: /usr/include/c++/4.8/iostream:61:18: note: 'std::cout' extern ostream cout; /// Linked to standard output ^ matrdivimp1.cpp: In function 'long long int sum(int (*)[101], int, int, int, int)': matrdivimp1.cpp:17:1: warning: control reaches end of non-void function [-Wreturn-type] } ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema MatrDivImp1 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ă.