#478
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 | #57058035 | Utilizator | |
Fișier | ciclu.cpp | Dimensiune | 857 B |
Data încărcării | 14 Martie 2025, 10:47 | Scor / rezultat | Eroare de compilare |
ciclu.cpp: In function 'void af(int)': ciclu.cpp:8:13: error: 'n' was not declared in this scope for(k=1;k<=n;k++) ^ ciclu.cpp:9:7: error: 'x' was not declared in this scope { g<<x[i]<<" ";} ^ ciclu.cpp:9:9: error: 'i' was not declared in this scope { g<<x[i]<<" ";} ^ ciclu.cpp:10:8: error: 'p' was not declared in this scope g<<p; ^ ciclu.cpp:11:5: error: 'gasit' was not declared in this scope gasit=1; ^ ciclu.cpp: In function 'int ora(int)': ciclu.cpp:17:8: error: 'a' was not declared in this scope if(a[x[k-1]][x[k]]!=1) return 0; ^ ciclu.cpp:17:10: error: 'x' was not declared in this scope if(a[x[k-1]][x[k]]!=1) return 0; ^ ciclu.cpp:18:15: error: 'i' was not declared in this scope else {for(i=1;i<k;i++) if(x[i]==x[k]) return 0;} ^ ciclu.cpp: In function 'void inu(int)': ciclu.cpp:24:6: error: 'i' was not declared in this scope {for(i=1;i<=n&&!gasit;i++){x[i]=k; ^ ciclu.cpp:24:13: error: 'n' was not declared in this scope {for(i=1;i<=n&&!gasit;i++){x[i]=k; ^ ciclu.cpp:24:17: error: 'gasit' was not declared in this scope {for(i=1;i<=n&&!gasit;i++){x[i]=k; ^ ciclu.cpp:24:28: error: 'x' was not declared in this scope {for(i=1;i<=n&&!gasit;i++){x[i]=k; ^ ciclu.cpp:26:15: error: 'a' was not declared in this scope if(ora(k)){if(a[x[k]][p]==1&&k>2) ^ ciclu.cpp:26:23: error: 'p' was not declared in this scope if(ora(k)){if(a[x[k]][p]==1&&k>2) ^ ciclu.cpp:37:40: error: conflicting declaration 'int x [201]' int a[21][21],n,m,i,j,x,y,gasit=0,x[201]; ^ ciclu.cpp:37:23: error: 'x' has a previous declaration as 'int x' int a[21][21],n,m,i,j,x,y,gasit=0,x[201]; ^ ciclu.cpp:39:1: error: a function-definition is not allowed here before '{' token {f>>n>>m; ^ ciclu.cpp:37:5: warning: unused variable 'a' [-Wunused-variable] int a[21][21],n,m,i,j,x,y,gasit=0,x[201]; ^ ciclu.cpp:37:15: warning: unused variable 'n' [-Wunused-variable] int a[21][21],n,m,i,j,x,y,gasit=0,x[201]; ^ ciclu.cpp:37:17: warning: unused variable 'm' [-Wunused-variable] int a[21][21],n,m,i,j,x,y,gasit=0,x[201]; ^ ciclu.cpp:37:19: warning: unused variable 'i' [-Wunused-variable] int a[21][21],n,m,i,j,x,y,gasit=0,x[201]; ^ ciclu.cpp:37:21: warning: unused variable 'j' [-Wunused-variable] int a[21][21],n,m,i,j,x,y,gasit=0,x[201]; ^ ciclu.cpp:37:23: warning: unused variable 'x' [-Wunused-variable] int a[21][21],n,m,i,j,x,y,gasit=0,x[201]; ^ ciclu.cpp:37:25: warning: unused variable 'y' [-Wunused-variable] int a[21][21],n,m,i,j,x,y,gasit=0,x[201]; ^ ciclu.cpp:37:27: warning: unused variable 'gasit' [-Wunused-variable] int a[21][21],n,m,i,j,x,y,gasit=0,x[201]; ^ ciclu.cpp:50:1: error: expected '}' at end of input } ^
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ă.