#126
Să se determine maximul distanţelor minime între nodul 1 şi celelalte noduri, într-un graf neorientat.
| Problema | DMax | Operații I/O |
dmax.in/dmax.out
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #62236559 | Utilizator | |
| Fișier | dmax.cpp | Dimensiune | 526 B |
| Data încărcării | 14 Ianuarie 2026, 15:05 | Scor/rezultat | Eroare de compilare |
dmax.cpp:5:1: error: expected ',' or ';' before 'ofstream' ofstream fout("dmax.out") ^ dmax.cpp: In function 'void BFS(int)': dmax.cpp:9:1: error: 'v' was not declared in this scope v[start]=1; ^ dmax.cpp:10:1: error: 'st' was not declared in this scope st=dr=1; ^ dmax.cpp:10:4: error: 'dr' was not declared in this scope st=dr=1; ^ dmax.cpp:11:1: error: 'c' was not declared in this scope c[1]=start; ^ dmax.cpp:14:5: error: 'x' was not declared in this scope x=c[st]; ^ dmax.cpp:15:16: error: 'n' was not declared in this scope for(int i=1;i<=n;i++) ^ dmax.cpp:16:17: error: 'a' was not declared in this scope if(v[i]==0&&a[x][i]==1) ^ dmax.cpp:21:1: error: expected ';' before '}' token } ^ dmax.cpp:24:1: error: 'dist' was not declared in this scope dist=c[dr]; ^ dmax.cpp: In function 'int main()': dmax.cpp:28:10: error: 'n' was not declared in this scope fin>>n>>m; ^ dmax.cpp:28:13: error: 'm' was not declared in this scope fin>>n>>m; ^ dmax.cpp:29:16: error: 'x' was not declared in this scope while(fin>>x>>y) ^ dmax.cpp:29:19: error: 'y' was not declared in this scope while(fin>>x>>y) ^ dmax.cpp:30:9: error: 'a' was not declared in this scope a[x][y]=a[y][x]=1; ^ dmax.cpp:32:9: error: 'fout' was not declared in this scope fout<<dist; ^ dmax.cpp:32:15: error: 'dist' was not declared in this scope fout<<dist; ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema DMax 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ă.