#2636
Se dau două numere n
și m
. Aflați care este numărul minim și numărul maxim de noduri izolate într-un graf neorientat cu n
noduri și m
muchii în care nu există o muchie de la un nod la el însuși și între oricare două noduri diferite există cel mult o muchie.
Problema | Noduri Izolate | Operații I/O |
![]() |
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #58133616 | Utilizator | |
Fișier | noduri_izolate.cpp | Dimensiune | 8.50 KB |
Data încărcării | 15 Mai 2025, 17:40 | Scor / rezultat | 100 puncte |
noduri_izolate.cpp: In function 'void ListaVecini()': noduri_izolate.cpp:48:28: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] if (idy==a[x].size()) a[x].push_back(y); ^ noduri_izolate.cpp:53:28: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] if (idx==a[y].size()) a[y].push_back(x); ^ noduri_izolate.cpp:62:37: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for (int j = 0; j<a[i].size(); j++) ^ noduri_izolate.cpp: In function 'bool check_adj(std::vector<std::vector<int> >&)': noduri_izolate.cpp:70:30: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for (int i = 1; i<v.size(); i++) ^ noduri_izolate.cpp:74:30: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for (int i = 1; i<v.size(); i++) ^ noduri_izolate.cpp: In function 'void grade()': noduri_izolate.cpp:105:28: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] if (idy==a[x].size()) a[x].push_back(y); ^ noduri_izolate.cpp:110:28: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] if (idx==a[y].size()) a[y].push_back(x); ^ noduri_izolate.cpp: In function 'void gradeK()': noduri_izolate.cpp:138:26: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] if (v[i].size()==goodk) good.push_back(i); ^ noduri_izolate.cpp: In function 'void GradK()': noduri_izolate.cpp:179:26: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] if (v[i].size()==k) good.push_back(i); ^ noduri_izolate.cpp: In function 'void Saturate()': noduri_izolate.cpp:206:49: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for (int i = 1; i<=n; i++) if (v[i].size()>=half) {fout<<i<<" "; check=1;} ^ noduri_izolate.cpp: In function 'void GradMax()': noduri_izolate.cpp:226:49: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for (int i = 1; i<=n; i++) if (v[i].size()==maxgrad) good.push_back(i); ^
Test | Timp | Mesaj evaluare | Scor posibil | Scor obținut | ||
---|---|---|---|---|---|---|
1 | 0 secunde | OK. | 5 | 5 | Exemplu | |
2 | 0 secunde | OK. | 5 | 5 | ||
3 | 0 secunde | OK. | 5 | 5 | ||
4 | 0 secunde | OK. | 5 | 5 | ||
5 | 0 secunde | OK. | 5 | 5 | ||
6 | 0 secunde | OK. | 5 | 5 | ||
7 | 0 secunde | OK. | 5 | 5 | ||
8 | 0 secunde | OK. | 5 | 5 | ||
9 | 0 secunde | OK. | 5 | 5 | ||
10 | 0 secunde | OK. | 5 | 5 | ||
11 | 0 secunde | OK. | 5 | 5 | ||
12 | 0 secunde | OK. | 5 | 5 | ||
13 | 0 secunde | OK. | 5 | 5 | ||
14 | 0 secunde | OK. | 5 | 5 | ||
15 | 0 secunde | OK. | 5 | 5 | ||
16 | 0 secunde | OK. | 5 | 5 | ||
17 | 0 secunde | OK. | 5 | 5 | ||
18 | 0 secunde | OK. | 5 | 5 | ||
19 | 0 secunde | OK. | 5 | 5 | ||
20 | 0 secunde | OK. | 5 | 5 | ||
Punctaj total | 100 |
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Noduri Izolate 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ă.