#1508
Element_SA
C++
Să se scrie o funcție C++ care are ca parametri două numere naturale n
și m
și o matrice A(n , m)
avȃnd elemente numere întregi și returnează numărul de elemente „șa” din matrice. Un element A(i,j)
din matrice se numește element „șa” dacă este maximul de pe coloana j
si minimul de pe linia i
sau invers.
Admitere Mate-Info UBB, iulie 2015
Problema | Element_SA | Operații I/O | tastatură/ecran |
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #52960104 | Utilizator | |
Fișier | element_sa.cpp | Dimensiune | 858 B |
Data încărcării | 14 Octombrie 2024, 11:59 | Scor / rezultat | Eroare de compilare |
element_sa.cpp: In function 'int nr_sa(int (*)[100], int, int)': element_sa.cpp:9:15: error: expected identifier before numeric constant int minL=[100],maxL=[100],minC=[100],maxC=[100],i,j,cate=0; ^ element_sa.cpp: In lambda function: element_sa.cpp:9:19: error: expected '{' before ',' token int minL=[100],maxL=[100],minC=[100],maxC=[100],i,j,cate=0; ^ element_sa.cpp: In function 'int nr_sa(int (*)[100], int, int)': element_sa.cpp:9:19: error: invalid user-defined conversion from 'nr_sa(int (*)[100], int, int)::__lambda0' to 'int' [-fpermissive] element_sa.cpp:9:18: note: candidate is: nr_sa(int (*)[100], int, int)::__lambda0::operator void (*)()() const <near match> int minL=[100],maxL=[100],minC=[100],maxC=[100],i,j,cate=0; ^ element_sa.cpp:9:18: note: no known conversion for implicit 'this' parameter from 'void (*)()' to 'int' element_sa.cpp:9:26: error: expected identifier before numeric constant int minL=[100],maxL=[100],minC=[100],maxC=[100],i,j,cate=0; ^ element_sa.cpp: In lambda function: element_sa.cpp:9:30: error: expected '{' before ',' token int minL=[100],maxL=[100],minC=[100],maxC=[100],i,j,cate=0; ^ element_sa.cpp: In function 'int nr_sa(int (*)[100], int, int)': element_sa.cpp:9:30: error: invalid user-defined conversion from 'nr_sa(int (*)[100], int, int)::__lambda1' to 'int' [-fpermissive] element_sa.cpp:9:29: note: candidate is: nr_sa(int (*)[100], int, int)::__lambda1::operator void (*)()() const <near match> int minL=[100],maxL=[100],minC=[100],maxC=[100],i,j,cate=0; ^ element_sa.cpp:9:29: note: no known conversion for implicit 'this' parameter from 'void (*)()' to 'int' element_sa.cpp:9:37: error: expected identifier before numeric constant int minL=[100],maxL=[100],minC=[100],maxC=[100],i,j,cate=0; ^ element_sa.cpp: In lambda function: element_sa.cpp:9:41: error: expected '{' before ',' token int minL=[100],maxL=[100],minC=[100],maxC=[100],i,j,cate=0; ^ element_sa.cpp: In function 'int nr_sa(int (*)[100], int, int)': element_sa.cpp:9:41: error: invalid user-defined conversion from 'nr_sa(int (*)[100], int, int)::__lambda2' to 'int' [-fpermissive] element_sa.cpp:9:40: note: candidate is: nr_sa(int (*)[100], int, int)::__lambda2::operator void (*)()() const <near match> int minL=[100],maxL=[100],minC=[100],maxC=[100],i,j,cate=0; ^ element_sa.cpp:9:40: note: no known conversion for implicit 'this' parameter from 'void (*)()' to 'int' element_sa.cpp:9:48: error: expected identifier before numeric constant int minL=[100],maxL=[100],minC=[100],maxC=[100],i,j,cate=0; ^ element_sa.cpp: In lambda function: element_sa.cpp:9:52: error: expected '{' before ',' token int minL=[100],maxL=[100],minC=[100],maxC=[100],i,j,cate=0; ^ element_sa.cpp: In function 'int nr_sa(int (*)[100], int, int)': element_sa.cpp:9:52: error: invalid user-defined conversion from 'nr_sa(int (*)[100], int, int)::__lambda3' to 'int' [-fpermissive] element_sa.cpp:9:51: note: candidate is: nr_sa(int (*)[100], int, int)::__lambda3::operator void (*)()() const <near match> int minL=[100],maxL=[100],minC=[100],maxC=[100],i,j,cate=0; ^ element_sa.cpp:9:51: note: no known conversion for implicit 'this' parameter from 'void (*)()' to 'int' element_sa.cpp:14:26: error: invalid types 'int[int]' for array subscript if(a[i][j]>maxL[i]) ^ element_sa.cpp:16:19: error: invalid types 'int[int]' for array subscript maxL[i]=a[i][j]; ^ element_sa.cpp:18:26: error: invalid types 'int[int]' for array subscript if(a[i][j]<minL[i]) ^ element_sa.cpp:20:19: error: invalid types 'int[int]' for array subscript minL[i]=a[i][j]; ^ element_sa.cpp:29:30: error: invalid types 'int[int]' for array subscript if(a[i][j]>maxC[i]) ^ element_sa.cpp:31:19: error: invalid types 'int[int]' for array subscript maxC[i]=a[i][j]; ^ element_sa.cpp:33:26: error: invalid types 'int[int]' for array subscript if(a[i][j]<minC[i]) ^ element_sa.cpp:35:19: error: invalid types 'int[int]' for array subscript minC[i]=a[i][j]; ^ element_sa.cpp:43:18: error: invalid types 'int[int]' for array subscript if(maxC[j]==minL[i] || minC[j]==maxL[i]) ^ element_sa.cpp:43:27: error: invalid types 'int[int]' for array subscript if(maxC[j]==minL[i] || minC[j]==maxL[i]) ^ element_sa.cpp:43:38: error: invalid types 'int[int]' for array subscript if(maxC[j]==minL[i] || minC[j]==maxL[i]) ^ element_sa.cpp:43:47: error: invalid types 'int[int]' for array subscript if(maxC[j]==minL[i] || minC[j]==maxL[i]) ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Element_SA face parte din a doua categorie. Pentru aceste probleme se folosește un program suport, furnizat de propunătorul problemei. 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ă.