#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 | #64345417 | Utilizator | |
| Fișier | gradek.cpp | Dimensiune | 660 B |
| Data încărcării | 30 Aprilie 2026, 18:04 | Scor/rezultat | Eroare de compilare |
gradek.cpp:6:23: error: expected initializer before ‘x’ 6 | int a[101][101],v[101]x,y,k,gr[101],n; | ^ gradek.cpp: In function ‘int main()’: gradek.cpp:9:10: error: ‘n’ was not declared in this scope 9 | fin>>n>>k; | ^ gradek.cpp:9:13: error: ‘k’ was not declared in this scope 9 | fin>>n>>k; | ^ gradek.cpp:10:16: error: ‘x’ was not declared in this scope 10 | while(fin>>x>>y){ | ^ gradek.cpp:10:19: error: ‘y’ was not declared in this scope 10 | while(fin>>x>>y){ | ^ gradek.cpp:12:13: error: ‘gr’ was not declared in this scope 12 | gr[x]++;gr[y]++; | ^~ gradek.cpp:18:12: error: ‘gr’ was not declared in this scope 18 | if(gr[i]==gr[k]) | ^~ gradek.cpp:19:12: error: ‘nr’ was not declared in this scope 19 | nr++; | ^~ gradek.cpp:18:9: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation] 18 | if(gr[i]==gr[k]) | ^~ gradek.cpp:20:12: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’ 20 | v[nr]=i; | ^ gradek.cpp:20:12: error: ‘v’ was not declared in this scope gradek.cpp:20:14: error: ‘nr’ was not declared in this scope 20 | v[nr]=i; | ^~ gradek.cpp:22:11: error: ‘nr’ was not declared in this scope 22 | fout<<nr<<endl; | ^~ gradek.cpp:24:26: error: ‘nt’ was not declared in this scope; did you mean ‘int’? 24 | for(int j=i+1;j<=nt;j++){ | ^~ | int gradek.cpp:25:16: error: ‘v’ was not declared in this scope 25 | if(v[i]>v[j]) | ^ gradek.cpp:30:11: error: ‘v’ was not declared in this scope 30 | fout<<v[i]<<" "; | ^
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ă.