#777
Se dă o matrice cu n linii şi m coloane şi elemente numere naturale. Să se determine câte coloane ale matricei au elementele distincte două câte două.
| Problema | CntColoane | Operații I/O |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64678891 | Utilizator | |
| Fișier | cntcoloane.cpp | Dimensiune | 479 B |
| Data încărcării | 22 Mai 2026, 10:26 | Scor/rezultat | 0 puncte |
cntcoloane.cpp: In function ‘bool isDistinct(int (*)[100], int, int)’: cntcoloane.cpp:5:1: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] 5 | for(int i=0;i<n;i++) | ^~~ cntcoloane.cpp:8:9: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’ 8 | return true;} | ^~~~~~ cntcoloane.cpp:6:17: warning: ‘j’ may be used uninitialized [-Wmaybe-uninitialized] 6 | for(int j=j+i;j<n;j++) | ^ cntcoloane.cpp:6:17: note: ‘j’ was declared here 6 | for(int j=j+i;j<n;j++) | ^ In function ‘bool isDistinct(int (*)[100], int, int)’, inlined from ‘int main()’ at cntcoloane.cpp:19:26: cntcoloane.cpp:6:17: warning: ‘j’ may be used uninitialized [-Wmaybe-uninitialized] 6 | for(int j=j+i;j<n;j++) | ^ cntcoloane.cpp: In function ‘int main()’: cntcoloane.cpp:6:17: note: ‘j’ was declared here 6 | for(int j=j+i;j<n;j++) | ^
| Test | Timp | Mesaj evaluare | Scor posibil | Scor obținut | ||
|---|---|---|---|---|---|---|
| 1 | 0.001 secunde | Raspuns gresit. | 20 | 0 | Exemplu | |
| 2 | 0.002 secunde | Raspuns gresit. | 40 | 0 | ||
| 3 | 0.003 secunde | Raspuns gresit. | 40 | 0 | ||
| Punctaj total | 0 | |||||
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema CntColoane 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ă.