#778
Se dă o matrice cu n linii şi m coloane şi elemente numere naturale. Să se determine mulțimea formată din elementele distincte ale chenarului matricei.
| Problema | MChenar | Operații I/O |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64580950 | Utilizator | |
| Fișier | mchenar.cpp | Dimensiune | 896 B |
| Data încărcării | 15 Mai 2026, 20:14 | Scor/rezultat | Eroare de compilare |
mchenar.cpp: In function ‘int main()’: mchenar.cpp:20:5: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] 20 | for (int i = 0; i < n; i++) | ^~~ mchenar.cpp:24:9: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’ 24 | int vec[4 * N]; | ^~~ mchenar.cpp:36:5: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] 36 | for (int i = 0; i < n; i++) | ^~~ mchenar.cpp:39:9: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’ 39 | set<int>::iterator itr; | ^~~ mchenar.cpp:39:9: error: ‘set’ was not declared in this scope; did you mean ‘std::set’? 39 | set<int>::iterator itr; | ^~~ | std::set In file included from /usr/include/c++/13/set:63, from mchenar.cpp:3: /usr/include/c++/13/bits/stl_set.h:96:11: note: ‘std::set’ declared here 96 | class set | ^~~ mchenar.cpp:39:13: error: expected primary-expression before ‘int’ 39 | set<int>::iterator itr; | ^~~ mchenar.cpp:42:10: error: ‘itr’ was not declared in this scope 42 | for (itr = mult.begin(); itr != mult.end(); itr++) | ^~~ mchenar.cpp:42:5: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] 42 | for (itr = mult.begin(); itr != mult.end(); itr++) | ^~~ mchenar.cpp:45:9: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’ 45 | return 0; | ^~~~~~ mchenar.cpp:24:13: warning: unused variable ‘vec’ [-Wunused-variable] 24 | int vec[4 * N]; | ^~~ mchenar.cpp:25:9: warning: unused variable ‘wi’ [-Wunused-variable] 25 | int wi = 0; | ^~ mchenar.cpp:17:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 17 | scanf("%d%d", &n, &m); | ~~~~~^~~~~~~~~~~~~~~~ mchenar.cpp:22:22: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 22 | scanf("%d", &mat[i][j]); | ~~~~~^~~~~~~~~~~~~~~~~~
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema MChenar 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ă.