#587
Într-un mall sunt n centre comerciale, numerotate de la 1 la n, unite între ele prin coridoare unidirecționale. Să se determine, dacă există, un centru comercial în care se poate ajunge din oricare altul.
| Problema | Mall | Operații I/O |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64284239 | Utilizator | |
| Fișier | mall.cpp | Dimensiune | 657 B |
| Data încărcării | 28 Aprilie 2026, 07:55 | Scor/rezultat | Eroare de compilare |
mall.cpp:1:1: error: ‘include’ does not name a type 1 | include<stdio.h> | ^~~~~~~ mall.cpp: In function ‘int main()’: mall.cpp:6:19: error: ‘n’ was not declared in this scope 6 | scanf("%d%d",&n,&m); | ^ mall.cpp:6:22: error: ‘m’ was not declared in this scope 6 | scanf("%d%d",&n,&m); | ^ mall.cpp:6:5: error: ‘scanf’ was not declared in this scope 6 | scanf("%d%d",&n,&m); | ^~~~~ mall.cpp:10:9: error: ‘a’ was not declared in this scope 10 | a[x][y]=1; | ^ mall.cpp:16:12: error: ‘a’ was not declared in this scope 16 | if(a[i][k]==1 &&a[k][j]==1) a[i][j]=1; | ^ mall.cpp:13:5: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] 13 | for(int k=1;i<=n;i++) | ^~~ mall.cpp:17:9: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’ 17 | int cod=0,c; | ^~~ mall.cpp:23:16: error: ‘a’ was not declared in this scope 23 | if(a[i][j]==0 &&i!=j) codul=0; | ^ mall.cpp:29:13: error: ‘printf’ was not declared in this scope 29 | printf("&d",c); | ^~~~~~ mall.cpp:1:1: note: ‘printf’ is defined in header ‘<cstdio>’; did you forget to ‘#include <cstdio>’? +++ |+#include <cstdio> 1 | include<stdio.h> mall.cpp:30:14: error: ‘printf’ was not declared in this scope 30 | else printf("NU EXISTA"); | ^~~~~~ mall.cpp:30:14: note: ‘printf’ is defined in header ‘<cstdio>’; did you forget to ‘#include <cstdio>’? mall.cpp:5:13: warning: unused variable ‘z’ [-Wunused-variable] 5 | int x,y,z,i; | ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Mall 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ă.