#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 | #57681634 | Utilizator | |
Fișier | gradek.cpp | Dimensiune | 659 B |
Data încărcării | 10 Aprilie 2025, 10:50 | Scor / rezultat | Eroare de compilare |
gradek.cpp:1:20: warning: extra tokens at end of #include directive [enabled by default] #include <iostream>#include <fstream>using namespace std;ifstream fin("gradek.in");ofstream fout("gradek.out");bool a[101][101]; ^ gradek.cpp:1:29: warning: invalid suffix on literal; C++11 requires a space between literal and identifier [-Wliteral-suffix] #include <iostream>#include <fstream>using namespace std;ifstream fin("gradek.in");ofstream fout("gradek.out");bool a[101][101]; ^ gradek.cpp: In function 'int main()': gradek.cpp:4:5: error: 'fin' was not declared in this scope fin>>n>>k; ^ gradek.cpp:6:8: error: 'a' was not declared in this scope a[i][j]=a[j][i]=1; ^ gradek.cpp:8:11: error: 'a' was not declared in this scope if(a[k][j]==1) cnt++; ^ gradek.cpp:12:16: error: 'a' was not declared in this scope if(a[i][j]==1) c++; ^ gradek.cpp:14:10: error: 'fout' was not declared in this scope } fout<<p<<endl; ^ gradek.cpp:14:19: error: 'endl' was not declared in this scope } fout<<p<<endl; ^ gradek.cpp:14:19: note: suggested alternative: In file included from /usr/include/c++/4.8/iostream:39:0, from gradek.cpp:1: /usr/include/c++/4.8/ostream:564:5: note: 'std::endl' endl(basic_ostream<_CharT, _Traits>& __os) ^ gradek.cpp:18:16: error: 'a' was not declared in this scope if(a[i][j]==1) c++; ^
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ă.