#475
Se dă lista muchiilor unui graf neorientat cu n vârfuri și două vârfuri p q. Să se determine toate lanțurile elementare cu extremitățile p și q.
| Problema | Lant | Operații I/O |
lant.in/lant.out
|
|---|---|---|---|
| Limita timp | 0.5 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #63068543 | Utilizator | |
| Fișier | lant.cpp | Dimensiune | 1.23 KB |
| Data încărcării | 12 Februarie 2026, 12:54 | Scor/rezultat | Eroare de compilare |
lant.cpp:4:14: warning: missing terminating " character [enabled by default] ifstream fin("lant.in); ^ lant.cpp:4:1: error: missing terminating " character ifstream fin("lant.in); ^ lant.cpp:5:15: warning: missing terminating " character [enabled by default] ofstream fout("lant.out); ^ lant.cpp:5:1: error: missing terminating " character ofstream fout("lant.out); ^ lant.cpp:7:18: error: 'n' has not been declared int A[101][101], n ,m, p, q; ^ lant.cpp:7:21: error: 'm' has not been declared int A[101][101], n ,m, p, q; ^ lant.cpp:7:24: error: 'p' has not been declared int A[101][101], n ,m, p, q; ^ lant.cpp:7:27: error: 'q' has not been declared int A[101][101], n ,m, p, q; ^ lant.cpp:7:28: error: expected ')' before ';' token int A[101][101], n ,m, p, q; ^ lant.cpp:7:28: error: expected ')' before ';' token lant.cpp: In function 'void afisare()': lant.cpp:17:9: error: 'fout' was not declared in this scope fout << lant[i] << " "; ^ lant.cpp:18:24: error: 'q' was not declared in this scope if( lant[i] == q) { cout << endl; return; }// oprire pentru ca e finalul lantului ^ lant.cpp:18:29: error: 'cout' was not declared in this scope if( lant[i] == q) { cout << endl; return; }// oprire pentru ca e finalul lantului ^ lant.cpp: In function 'void gen(int, int)': lant.cpp:26:24: error: 'q' was not declared in this scope if( lant[poz-1] == q ) ^ lant.cpp:29:21: error: 'n' was not declared in this scope for(int i=1; i<=n; i++) ^ lant.cpp:30:13: error: 'A' was not declared in this scope if( A[nod][i] == 1 && fol[i] == 0 ) // este muchie si nu repet nodul ^ lant.cpp: In function 'int main()': lant.cpp:44:12: error: 'n' was not declared in this scope fin >> n >> m; // noduri si nr de muchii ^ lant.cpp:44:17: error: 'm' was not declared in this scope fin >> n >> m; // noduri si nr de muchii ^ lant.cpp:47:16: error: invalid operands of types 'std::ifstream(std::ofstream (*)(int (*)[101], int, int, int, int)) {aka std::basic_ifstream<char>(std::basic_ofstream<char> (*)(int (*)[101], int, int, int, int))}' and 'int' to binary 'operator>>' fin >> a >> b; ^ lant.cpp:48:9: error: 'A' was not declared in this scope A[a][b] = 1; A[b][a] = 1; ^ lant.cpp:51:12: error: 'p' was not declared in this scope fin >> p >> q; // inceput si sfarsit la lant ^ lant.cpp:51:17: error: 'q' was not declared in this scope fin >> p >> q; // inceput si sfarsit la lant ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Lant 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ă.