#4155
Harta unei regiuni este reprezentată într-un sistem de coordonate cartezian și sunt cunoscute coordonatele a n orașe, numerotate de la 1 la n.
Se dorește construirea unor drumuri bidirecționale între anumite perechi de orașe, astfel încât:
Să se determine suma lungimilor drumurilor construite.
| Problema | Harta3 | Operații I/O |
harta3.in/harta3.out
|
|---|---|---|---|
| Limita timp | 0.2 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64816264 | Utilizator | |
| Fișier | harta3.cpp | Dimensiune | 1.19 KB |
| Data încărcării | 03 Iunie 2026, 11:04 | Scor/rezultat | Eroare de compilare |
harta3.cpp: In function ‘void citire()’: harta3.cpp:14:23: error: ‘struct data’ has no member named ‘st’; did you mean ‘s’? 14 | muchie[++m].st=i; | ^~ | s harta3.cpp:15:21: error: ‘struct data’ has no member named ‘dr’; did you mean ‘d’? 15 | muchie[m].dr=j; | ^~ | d harta3.cpp:16:21: error: ‘struct data’ has no member named ‘cost’ 16 | muchie[m].cost=sqrt((x[i]-x[i])*(x[i]-x[j])+(y[i]-y[j])*(y[i]-y[j])); | ^~~~ harta3.cpp:16:26: error: ‘sqrt’ was not declared in this scope 16 | muchie[m].cost=sqrt((x[i]-x[i])*(x[i]-x[j])+(y[i]-y[j])*(y[i]-y[j])); | ^~~~ harta3.cpp: In function ‘void ordonare()’: harta3.cpp:22:8: error: ‘e’ was not declared in this scope 22 | if(e[i].c>e[j].c) swap(e[i],e[j]); | ^ harta3.cpp: In function ‘void AMP()’: harta3.cpp:28:29: error: ‘e’ was not declared in this scope 28 | do{ind++;} while(cc[e[ind].s]==cc[e[ind].d]); | ^ harta3.cpp:38:9: error: ‘rez’ was not declared in this scope 38 | rez[ms].s=u;rez[ms].d=v; | ^~~ harta3.cpp:42:34: error: ‘rez’ was not declared in this scope 42 | for(int i=1;i<=ms;i++) fout<<rez[i].s<<" "<<rez[i].d<<'\n'; | ^~~ harta3.cpp:25:20: warning: unused variable ‘k’ [-Wunused-variable] 25 | int ms=0,ind=0,k; | ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Harta3 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ă.