#4064
Într-un oraș sunt n case numerotate de la 1 la n. Între anumite case sunt străzi bidirecționale. În casa cu indicele g locuiește Ghiocel. El are k colege ale căror numere de casă îi sunt cunoscute și Ghiocel dorește să le ducă ghicei la inceputul lunii martie. Pentru că este leneș, Ghiocel se decide să ducă ghiocei colegei sau colegelor care stă (stau) la o casă până la care Ghiocel are de parcurs un număr minim de străzi. Ajutați-l pe Ghiocel să determine numerele acestor case.
| Problema | Ghiocel | Operații I/O |
ghiocel.in/ghiocel.out
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #63724141 | Utilizator | |
| Fișier | ghiocel.cpp | Dimensiune | 2.68 KB |
| Data încărcării | 16 Martie 2026, 18:44 | Scor/rezultat | Eroare de compilare |
ghiocel.cpp:76:13: error: redefinition of 'std::ifstream fin' ifstream fin("ghiocel.in"); ^ ghiocel.cpp:4:10: error: 'std::ifstream fin' previously declared here ifstream fin("ghiocel.in"); ^ ghiocel.cpp:77:14: error: redefinition of 'std::ofstream fout' ofstream fout("ghiocel.out"); ^ ghiocel.cpp:5:10: error: 'std::ofstream fout' previously declared here ofstream fout("ghiocel.out"); ^ ghiocel.cpp:78:5: error: redefinition of 'int n' int n,m,g,a[105][105],k,col[105]; ^ ghiocel.cpp:6:5: error: 'int n' previously declared here int n,m,g,a[105][105],k,col[105]; ^ ghiocel.cpp:78:7: error: redefinition of 'int m' int n,m,g,a[105][105],k,col[105]; ^ ghiocel.cpp:6:7: error: 'int m' previously declared here int n,m,g,a[105][105],k,col[105]; ^ ghiocel.cpp:78:9: error: redefinition of 'int g' int n,m,g,a[105][105],k,col[105]; ^ ghiocel.cpp:6:9: error: 'int g' previously declared here int n,m,g,a[105][105],k,col[105]; ^ ghiocel.cpp:78:21: error: redefinition of 'int a [105][105]' int n,m,g,a[105][105],k,col[105]; ^ ghiocel.cpp:6:11: error: 'int a [105][105]' previously declared here int n,m,g,a[105][105],k,col[105]; ^ ghiocel.cpp:78:23: error: redefinition of 'int k' int n,m,g,a[105][105],k,col[105]; ^ ghiocel.cpp:6:23: error: 'int k' previously declared here int n,m,g,a[105][105],k,col[105]; ^ ghiocel.cpp:78:32: error: redefinition of 'int col [105]' int n,m,g,a[105][105],k,col[105]; ^ ghiocel.cpp:6:25: error: 'int col [105]' previously declared here int n,m,g,a[105][105],k,col[105]; ^ ghiocel.cpp:79:12: error: redefinition of 'int viz [105]' int viz[105],t[105]; ^ ghiocel.cpp:7:5: error: 'int viz [105]' previously declared here int viz[105],t[105]; ^ ghiocel.cpp:79:19: error: redefinition of 'int t [105]' int viz[105],t[105]; ^ ghiocel.cpp:7:14: error: 'int t [105]' previously declared here int viz[105],t[105]; ^ ghiocel.cpp: In function 'void citire()': ghiocel.cpp:80:6: error: redefinition of 'void citire()' void citire() ^ ghiocel.cpp:8:6: error: 'void citire()' previously defined here void citire() ^ ghiocel.cpp: In function 'void BFS()': ghiocel.cpp:97:6: error: redefinition of 'void BFS()' void BFS() ^ ghiocel.cpp:25:6: error: 'void BFS()' previously defined here void BFS() ^ ghiocel.cpp: In function 'int lungime_minima()': ghiocel.cpp:112:5: error: redefinition of 'int lungime_minima()' int lungime_minima() ^ ghiocel.cpp:40:5: error: 'int lungime_minima()' previously defined here int lungime_minima() ^ ghiocel.cpp: In function 'void afisare()': ghiocel.cpp:125:6: error: redefinition of 'void afisare()' void afisare() ^ ghiocel.cpp:53:6: error: 'void afisare()' previously defined here void afisare() ^ ghiocel.cpp: In function 'int main()': ghiocel.cpp:138:5: error: redefinition of 'int main()' int main() ^ ghiocel.cpp:66:5: error: 'int main()' previously defined here int main() ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Ghiocel 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ă.