#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 |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64774715 | Utilizator | |
| Fișier | noduri_izolate.cpp | Dimensiune | 373 B |
| Data încărcării | 29 Mai 2026, 12:49 | Scor/rezultat | 30 puncte |
noduri_izolate.cpp: In function ‘int main()’: noduri_izolate.cpp:7:6: warning: ‘m’ is used uninitialized [-Wuninitialized] 7 | if(m==0) | ^~ noduri_izolate.cpp:5:10: note: ‘m’ was declared here 5 | int m,b,a; | ^ noduri_izolate.cpp:14:20: warning: ‘k’ may be used uninitialized [-Wmaybe-uninitialized] 14 | while(111*k*(k-1)/2<m) | ~~^~~ noduri_izolate.cpp:6:16: note: ‘k’ was declared here 6 | long long k,n; | ^ In file included from /usr/include/c++/13/iostream:41, from noduri_izolate.cpp:1: In member function ‘std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long int) [with _CharT = char; _Traits = std::char_traits<char>]’, inlined from ‘int main()’ at noduri_izolate.cpp:9:16: /usr/include/c++/13/ostream:204:25: warning: ‘n’ may be used uninitialized [-Wmaybe-uninitialized] 204 | { return _M_insert(__n); } | ~~~~~~~~~^~~~~ noduri_izolate.cpp: In function ‘int main()’: noduri_izolate.cpp:6:18: note: ‘n’ was declared here 6 | long long k,n; | ^
| Test | Timp | Mesaj evaluare | Scor posibil | Scor obținut | ||
|---|---|---|---|---|---|---|
| 1 | 0.001 secunde | Raspuns gresit. | 5 | 0 | Exemplu | |
| 2 | 0.001 secunde | Raspuns gresit. | 5 | 0 | ||
| 3 | 0.001 secunde | Raspuns gresit. | 5 | 0 | ||
| 4 | 0.001 secunde | Raspuns gresit. | 5 | 0 | ||
| 5 | 0.001 secunde | Raspuns gresit. | 5 | 0 | ||
| 6 | 0.001 secunde | Raspuns gresit. | 5 | 0 | ||
| 7 | 0.001 secunde | Raspuns gresit. | 5 | 0 | ||
| 8 | 0.001 secunde | Raspuns gresit. | 5 | 0 | ||
| 9 | 0.001 secunde | Raspuns gresit. | 5 | 0 | ||
| 10 | 0.001 secunde | OK. | 5 | 5 | ||
| 11 | 0.001 secunde | Raspuns gresit. | 5 | 0 | ||
| 12 | 0.001 secunde | Raspuns gresit. | 5 | 0 | ||
| 13 | 0.001 secunde | Raspuns gresit. | 5 | 0 | ||
| 14 | 0.001 secunde | OK. | 5 | 5 | ||
| 15 | 0.001 secunde | OK. | 5 | 5 | ||
| 16 | 0.001 secunde | Raspuns gresit. | 5 | 0 | ||
| 17 | 0.001 secunde | Raspuns gresit. | 5 | 0 | ||
| 18 | 0.001 secunde | OK. | 5 | 5 | ||
| 19 | 0.001 secunde | OK. | 5 | 5 | ||
| 20 | 0 secunde | OK. | 5 | 5 | ||
| Punctaj total | 30 | |||||
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ă.