#484
Se dă lista muchiilor unui graf neorientat și două vârfuri p q
. Să se determine cel mai scurt lanț cu extremitățile p q
.
Problema | LantMinim | Operații I/O |
![]() lantminim.in /lantminim.out
|
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #57375121 | Utilizator | |
Fișier | lantminim.cpp | Dimensiune | 801 B |
Data încărcării | 27 Martie 2025, 21:56 | Scor / rezultat | Eroare de compilare |
lantminim.cpp: In function 'bool valid(int)': lantminim.cpp:9:5: error: 'g' was not declared in this scope if(g[s[k]][s[k - 1]] == 0) return 0; ^ lantminim.cpp:9:7: error: 's' was not declared in this scope if(g[s[k]][s[k - 1]] == 0) return 0; ^ lantminim.cpp:10:5: error: 'viz' was not declared in this scope if(viz[s[k]] == 1) return 0; ^ lantminim.cpp:10:9: error: 's' was not declared in this scope if(viz[s[k]] == 1) return 0; ^ lantminim.cpp:12:6: error: 's' was not declared in this scope if(s[k] == s[i]) return 0; ^ lantminim.cpp:14:2: error: 'lglant' was not declared in this scope lglant++; ^ lantminim.cpp: In function 'void bkt(int)': lantminim.cpp:19:22: error: 'n' was not declared in this scope for(int i = 1; i <= n; i++) { ^ lantminim.cpp:20:3: error: 's' was not declared in this scope s[k] = i; ^ lantminim.cpp:22:23: error: 'afisare' was not declared in this scope if(k == n) afisare(); ^ lantminim.cpp: In function 'void bfs(int)': lantminim.cpp:29:11: error: 'dr' was not declared in this scope int st = dr = 1; ^ lantminim.cpp:30:2: error: 'viz' was not declared in this scope viz[p] = 1; ^ lantminim.cpp:32:6: error: 'k' was not declared in this scope k = queue[st]; ^ lantminim.cpp:32:15: error: missing template arguments before '[' token k = queue[st]; ^ lantminim.cpp:33:23: error: 'n' was not declared in this scope for(int i = 1; i <= n; i++) { ^ lantminim.cpp:34:7: error: 'graf' was not declared in this scope if(graf[k][i] == 1 && viz[i] == 0) { ^ lantminim.cpp:35:10: error: missing template arguments before '[' token queue[++dr] = i; ^ lantminim.cpp: In function 'int main()': lantminim.cpp:46:8: error: 'n' was not declared in this scope in >> n; ^ lantminim.cpp:47:8: error: 'p' was not declared in this scope in >> p >> q; ^ lantminim.cpp:47:13: error: 'q' was not declared in this scope in >> p >> q; ^ lantminim.cpp:48:8: error: 'fin' was not declared in this scope while(fin >> x >> y) { ^ lantminim.cpp:48:15: error: 'x' was not declared in this scope while(fin >> x >> y) { ^ lantminim.cpp:48:20: error: 'y' was not declared in this scope while(fin >> x >> y) { ^ lantminim.cpp:49:3: error: 'graf' was not declared in this scope graf[x][y] = graf[y][x] = 1; ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema LantMinim 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ă.