#478
Ciclu
Se dă lista muchiilor unui graf neorientat cu n
vârfuri și un vârf p
. Să se determine un ciclu elementar care conține vârful p
.
Problema | Ciclu | Operații I/O |
ciclu.in /ciclu.out
|
---|---|---|---|
Limita timp | 0.5 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #29493718 | Utilizator | |
Fișier | ciclu.cpp | Dimensiune | 1.87 KB |
Data încărcării | 05 Mai 2021, 11:28 | Scor / rezultat | Eroare de compilare |
ciclu.cpp:55:2: error: stray '#' in program }#include <fstream> ^ ciclu.cpp: In function 'void back(int)': ciclu.cpp:36:15: warning: suggest explicit braces to avoid ambiguous 'else' [-Wparentheses] if(oke(k)) ^ ciclu.cpp: At global scope: ciclu.cpp:55:3: error: 'include' does not name a type }#include <fstream> ^ ciclu.cpp:59:13: error: redefinition of 'std::ifstream cin' ifstream cin("ciclu.in"); ^ ciclu.cpp:5:10: error: 'std::ifstream cin' previously declared here ifstream cin("ciclu.in"); ^ ciclu.cpp:60:14: error: redefinition of 'std::ofstream cout' ofstream cout("ciclu.out"); ^ ciclu.cpp:6:10: error: 'std::ofstream cout' previously declared here ofstream cout("ciclu.out"); ^ ciclu.cpp:62:18: error: redefinition of 'std::vector<int> G [101]' vector <int>G[101]; ^ ciclu.cpp:8:13: error: 'std::vector<int> G [101]' previously declared here vector <int>G[101]; ^ ciclu.cpp:64:5: error: redefinition of 'int n' int n , m , x , y , P[30] , X[30] , p , ok; ^ ciclu.cpp:10:5: error: 'int n' previously declared here int n , m , x , y , P[30] , X[30] , p , ok; ^ ciclu.cpp:64:9: error: redefinition of 'int m' int n , m , x , y , P[30] , X[30] , p , ok; ^ ciclu.cpp:10:9: error: 'int m' previously declared here int n , m , x , y , P[30] , X[30] , p , ok; ^ ciclu.cpp:64:13: error: redefinition of 'int x' int n , m , x , y , P[30] , X[30] , p , ok; ^ ciclu.cpp:10:13: error: 'int x' previously declared here int n , m , x , y , P[30] , X[30] , p , ok; ^ ciclu.cpp:64:17: error: redefinition of 'int y' int n , m , x , y , P[30] , X[30] , p , ok; ^ ciclu.cpp:10:17: error: 'int y' previously declared here int n , m , x , y , P[30] , X[30] , p , ok; ^ ciclu.cpp:64:25: error: redefinition of 'int P [30]' int n , m , x , y , P[30] , X[30] , p , ok; ^ ciclu.cpp:10:21: error: 'int P [30]' previously declared here int n , m , x , y , P[30] , X[30] , p , ok; ^ ciclu.cpp:64:33: error: redefinition of 'int X [30]' int n , m , x , y , P[30] , X[30] , p , ok; ^ ciclu.cpp:10:29: error: 'int X [30]' previously declared here int n , m , x , y , P[30] , X[30] , p , ok; ^ ciclu.cpp:64:37: error: redefinition of 'int p' int n , m , x , y , P[30] , X[30] , p , ok; ^ ciclu.cpp:10:37: error: 'int p' previously declared here int n , m , x , y , P[30] , X[30] , p , ok; ^ ciclu.cpp:64:41: error: redefinition of 'int ok' int n , m , x , y , P[30] , X[30] , p , ok; ^ ciclu.cpp:10:41: error: 'int ok' previously declared here int n , m , x , y , P[30] , X[30] , p , ok; ^ ciclu.cpp: In function 'void afisare(int)': ciclu.cpp:66:6: error: redefinition of 'void afisare(int)' void afisare(int k) ^ ciclu.cpp:12:6: error: 'void afisare(int)' previously defined here void afisare(int k) ^ ciclu.cpp: In function 'int oke(int)': ciclu.cpp:74:5: error: redefinition of 'int oke(int)' int oke(int k) ^ ciclu.cpp:20:5: error: 'int oke(int)' previously defined here int oke(int k) ^ ciclu.cpp: In function 'void back(int)': ciclu.cpp:83:6: error: redefinition of 'void back(int)' void back(int k) ^ ciclu.cpp:29:6: error: 'void back(int)' previously defined here void back(int k) ^ ciclu.cpp:90:15: warning: suggest explicit braces to avoid ambiguous 'else' [-Wparentheses] if(oke(k)) ^ ciclu.cpp: In function 'int main()': ciclu.cpp:97:5: error: redefinition of 'int main()' int main() ^ ciclu.cpp:43:5: error: 'int main()' previously defined here int main() ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Ciclu 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ă.