#478
Ciclu
Se dă lista muchiilor unui graf neorientat cu n
vârfuri și un vârf p
. Să se determine un ciclu elementar care conține vârful p
.
Problema | Ciclu | Operații I/O |
![]() ciclu.in /ciclu.out
|
---|---|---|---|
Limita timp | 0.5 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #35035483 | Utilizator | |
Fișier | ciclu.cpp | Dimensiune | 1.05 KB |
Data încărcării | 23 Februarie 2022, 12:58 | Scor / rezultat | Eroare de compilare |
ciclu.cpp:7:9: error: expected initializer before 'a' int n,m a[105][105], viz[205], p, ok = 0; ^ ciclu.cpp: In function 'void afis(int)': ciclu.cpp:13:14: error: 'viz' was not declared in this scope g << viz[i] << " "; ^ ciclu.cpp:14:10: error: 'p' was not declared in this scope g << p << " "; ^ ciclu.cpp:15:5: error: 'ok' was not declared in this scope ok = 1; ^ ciclu.cpp: In function 'bool cond(int)': ciclu.cpp:20:9: error: 'a' was not declared in this scope if (a[viz[k - 1]][viz[k]] != 1) ^ ciclu.cpp:20:11: error: 'viz' was not declared in this scope if (a[viz[k - 1]][viz[k]] != 1) ^ ciclu.cpp:23:13: error: 'viz' was not declared in this scope if (viz[k] == viz[i]) ^ ciclu.cpp: In function 'void back(int)': ciclu.cpp:31:32: error: 'ok' was not declared in this scope for (int i = 1; i <= n && !ok; ++i) ^ ciclu.cpp:33:9: error: 'viz' was not declared in this scope viz[k] = i; ^ ciclu.cpp:36:17: error: 'a' was not declared in this scope if (a[viz[k]][p] == 1 && k > 2){ ^ ciclu.cpp:36:27: error: 'p' was not declared in this scope if (a[viz[k]][p] == 1 && k > 2){ ^ ciclu.cpp: In function 'void citire()': ciclu.cpp:46:15: error: 'm' was not declared in this scope f >> n >> m; ^ ciclu.cpp:50:9: error: 'a' was not declared in this scope a[i][j] = a[j][i] = 1; ^ ciclu.cpp:53:10: error: 'p' was not declared in this scope f >> p; ^ ciclu.cpp: In function 'int main()': ciclu.cpp:67:5: error: 'viz' was not declared in this scope viz[1] = p; ^ ciclu.cpp:67:14: error: 'p' was not declared in this scope viz[1] = p; ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Ciclu 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ă.