#3421
Se dă un graf orientat cu n vârfuri și m arce prin lista arcelor și un număr natural k. Afișați numărul de vârfuri ale componentei tare conexe în care se află vârful k.
| Problema | ctck | Operații I/O |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #63062951 | Utilizator | |
| Fișier | ctck.cpp | Dimensiune | 2.72 KB |
| Data încărcării | 12 Februarie 2026, 10:35 | Scor/rezultat | Eroare de compilare |
ctck.cpp: In function 'void dfs(int)': ctck.cpp:66:26: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for(i=0; i<G[x].size(); i++) ^ ctck.cpp: In function 'void dfst(int)': ctck.cpp:78:27: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for(i=0; i<GT[x].size(); i++) ^ ctck.cpp: In function 'void afisare()': ctck.cpp:86:9: warning: unused variable 'i' [-Wunused-variable] int i,j; ^ ctck.cpp:86:11: warning: unused variable 'j' [-Wunused-variable] int i,j; ^ ctck.cpp: At global scope: ctck.cpp:96:5: error: redefinition of 'int n' int n,k; ^ ctck.cpp:7:5: error: 'int n' previously declared here int n,k; ^ ctck.cpp:96:7: error: redefinition of 'int k' int n,k; ^ ctck.cpp:7:7: error: 'int k' previously declared here int n,k; ^ ctck.cpp:97:5: error: redefinition of 'int nrct' int nrct; //nr componente tare conexe ^ ctck.cpp:8:5: error: 'int nrct' previously declared here int nrct; //nr componente tare conexe ^ ctck.cpp:98:5: error: redefinition of 'int poz' int poz; ^ ctck.cpp:9:5: error: 'int poz' previously declared here int poz; ^ ctck.cpp:100:14: error: redefinition of 'bool viz [100002]' bool viz[NMAX]; ^ ctck.cpp:11:6: error: 'bool viz [100002]' previously declared here bool viz[NMAX]; ^ ctck.cpp:101:20: error: redefinition of 'int postordine [100002]' int postordine[NMAX]; ^ ctck.cpp:12:5: error: 'int postordine [100002]' previously declared here int postordine[NMAX]; ^ ctck.cpp:103:19: error: redefinition of 'std::vector<int> G [100002]' vector<int> G[NMAX]; ^ ctck.cpp:14:13: error: 'std::vector<int> G [100002]' previously declared here vector<int> G[NMAX]; ^ ctck.cpp:104:20: error: redefinition of 'std::vector<int> GT [100002]' vector<int> GT[NMAX]; ^ ctck.cpp:15:13: error: 'std::vector<int> GT [100002]' previously declared here vector<int> GT[NMAX]; ^ ctck.cpp:105:21: error: redefinition of 'std::vector<int> CTC [100002]' vector<int> CTC[NMAX]; ^ ctck.cpp:16:13: error: 'std::vector<int> CTC [100002]' previously declared here vector<int> CTC[NMAX]; ^ ctck.cpp: In function 'int main()': ctck.cpp:112:5: error: redefinition of 'int main()' int main() ^ ctck.cpp:23:5: error: 'int main()' previously defined here int main() ^ ctck.cpp: In function 'void citire()': ctck.cpp:131:6: error: redefinition of 'void citire()' void citire() ^ ctck.cpp:42:6: error: 'void citire()' previously defined here void citire() ^ ctck.cpp: In function 'void dfs(int)': ctck.cpp:149:6: error: redefinition of 'void dfs(int)' void dfs(int x) ^ ctck.cpp:60:6: error: 'void dfs(int)' previously defined here void dfs(int x) ^ ctck.cpp:155:26: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for(i=0; i<G[x].size(); i++) ^ ctck.cpp: In function 'void dfst(int)': ctck.cpp:161:6: error: redefinition of 'void dfst(int)' void dfst(int x) ^ ctck.cpp:72:6: error: 'void dfst(int)' previously defined here void dfst(int x) ^ ctck.cpp:167:27: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for(i=0; i<GT[x].size(); i++) ^ ctck.cpp: In function 'void afisare()': ctck.cpp:173:6: error: redefinition of 'void afisare()' void afisare() ^ ctck.cpp:84:6: error: 'void afisare()' previously defined here void afisare() ^ ctck.cpp:175:9: warning: unused variable 'i' [-Wunused-variable] int i,j; ^ ctck.cpp:175:11: warning: unused variable 'j' [-Wunused-variable] int i,j; ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema ctck 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ă.