#3697
Fie G un graf orientat cu N
noduri și M
arce. Spunem că nodul Y
este accesibil din nodul X
dacă se poate ajunge de la X
la Y
mergând pe arce în sensul corespunzător al acestora. Spunem că nodul X
este “popular” dacă pentru fiecare nod Y
al grafului G se îndeplinește cel puțin una din condițiile:
1. X
este accesibil din Y
;
2. Y
este accesibil din X
.
Dându-se cele două numere N
si M
cât si arcele grafului, să se afle care sunt nodurile populare din graf.
ONI 2013, Clasele XI-XII
Problema | drumuri2 | Operații I/O |
![]() drumuri.in /drumuri.out
|
---|---|---|---|
Limita timp | 0.3 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #56724044 | Utilizator | |
Fișier | drumuri2.cpp | Dimensiune | 4.06 KB |
Data încărcării | 04 Martie 2025, 07:45 | Scor / rezultat | 100 puncte |
drumuri2.cpp: In function 'void dfs(int)': drumuri2.cpp:31:33: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for(int j=0;j<adj[nod].size();j++) ^ drumuri2.cpp: In function 'void dfs2(int, int&)': drumuri2.cpp:40:32: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for(int j=0;j<gt[nod].size();j++) ^ drumuri2.cpp: In function 'void dfs_nivel(int)': drumuri2.cpp:49:36: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for(int j=0;j<graf_2[nod].size();j++) ^ drumuri2.cpp: In function 'int main()': drumuri2.cpp:104:38: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for(int j=0;j<graf_2[i].size();j++) ^ drumuri2.cpp:144:35: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for(int j=0;j<niv[i].size();j++) ^ drumuri2.cpp:151:44: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for(int k=0;k<graf_2[nod].size();k++) ^ drumuri2.cpp:155:44: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for(int k=0;k<graf_2[nod].size();k++) ^ drumuri2.cpp:166:29: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for(int i=0;i<rasp.size();i++) ^ drumuri2.cpp:171:44: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for(int k=0;k<comp_conex[cmp].size();k++) rez.push_back(comp_conex[cmp][k]); ^ drumuri2.cpp:175:28: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for(int i=0;i<rez.size();i++) g<<rez[i]<<' '; ^
Test | Timp | Mesaj evaluare | Scor posibil | Scor obținut | ||
---|---|---|---|---|---|---|
0 | 0.004 secunde | OK. | 5 | 5 | ||
1 | 0 secunde | OK. | 5 | 5 | ||
2 | 0 secunde | OK. | 5 | 5 | ||
3 | 0.004 secunde | OK. | 5 | 5 | ||
4 | 0.004 secunde | OK. | 5 | 5 | ||
5 | 0.004 secunde | OK. | 5 | 5 | ||
6 | 0.004 secunde | OK. | 5 | 5 | ||
7 | 0.004 secunde | OK. | 5 | 5 | ||
8 | 0.004 secunde | OK. | 5 | 5 | ||
9 | 0.004 secunde | OK. | 5 | 5 | ||
10 | 0.02 secunde | OK. | 5 | 5 | ||
11 | 0.02 secunde | OK. | 5 | 5 | ||
12 | 0.048 secunde | OK. | 5 | 5 | ||
13 | 0.048 secunde | OK. | 5 | 5 | ||
14 | 0.068 secunde | OK. | 5 | 5 | ||
15 | 0.064 secunde | OK. | 5 | 5 | ||
16 | 0.112 secunde | OK. | 5 | 5 | ||
17 | 0.108 secunde | OK. | 5 | 5 | ||
18 | 0.144 secunde | OK. | 5 | 5 | ||
19 | 0.164 secunde | OK. | 5 | 5 | ||
Punctaj total | 100 |
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema drumuri2 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ă.