#4068
Se dă lista muchiilor unui graf neorientat și un nod k
. Să se determine nodurile din graf care au gradul egal cu gradul nodului k
.
Problema | GradeK | Operații I/O |
![]() gradek.in /gradek.out
|
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #46169310 | Utilizator | |
Fișier | gradek.cpp | Dimensiune | 553 B |
Data încărcării | 06 Noiembrie 2023, 10:36 | Scor / rezultat | Eroare de compilare |
gradek.cpp:6:1: error: expected ',' or ';' before 'int' int a[101][101],n,k; ^ gradek.cpp: In function 'void construire()': gradek.cpp:10:10: error: 'n' was not declared in this scope fin>>n; ^ gradek.cpp:13:9: error: 'a' was not declared in this scope a[x][y]=1; ^ gradek.cpp: In function 'int grad(int)': gradek.cpp:20:16: error: 'n' was not declared in this scope for(j=1;j<=n;j++) ^ gradek.cpp:21:12: error: 'a' was not declared in this scope if(a[x][j]==1) gr++; ^ gradek.cpp: In function 'int main()': gradek.cpp:27:16: error: 'n' was not declared in this scope for(i=1;i<=n;i++) ^ gradek.cpp:28:16: error: 'gr' was not declared in this scope if(gr(i)==gr(k)) nr++; ^ gradek.cpp:28:22: error: 'k' was not declared in this scope if(gr(i)==gr(k)) nr++; ^ gradek.cpp:30:16: error: 'n' was not declared in this scope for(i=1;i<=n;i++) ^ gradek.cpp:31:16: error: 'gr' was not declared in this scope if(gr(i)==gr(k)) fout<<i<<" "; ^ gradek.cpp:31:22: error: 'k' was not declared in this scope if(gr(i)==gr(k)) fout<<i<<" "; ^ gradek.cpp:26:11: warning: unused variable 'j' [-Wunused-variable] int i,j,nr=0; ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema GradeK 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ă.