#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 | #61388845 | Utilizator | |
| Fișier | harta3.cpp | Dimensiune | 1.04 KB |
| Data încărcării | 26 Noiembrie 2025, 12:29 | Scor/rezultat | Eroare de compilare |
harta3.cpp:1:10: error: #include expects "FILENAME" or <FILENAME> #include <iostream> ^ harta3.cpp:2:10: error: #include expects "FILENAME" or <FILENAME> #include <fstream> ^ harta3.cpp:3:10: error: #include expects "FILENAME" or <FILENAME> #include <iomanip> ^ harta3.cpp:4:10: error: #include expects "FILENAME" or <FILENAME> #include <cmath> ^ harta3.cpp:6:1: error: 'ifstream' does not name a type ifstream fin("harta3.in"); ^ harta3.cpp:6:20: error: 'harta3' does not name a type ifstream fin("harta3.in"); ^ harta3.cpp:6:35: error: expected unqualified-id before ')' token ifstream fin("harta3.in"); ^ harta3.cpp:7:1: error: 'ofstream' does not name a type ofstream fout("harta3.out"); ^ harta3.cpp:7:21: error: 'harta3' does not name a type ofstream fout("harta3.out"); ^ harta3.cpp:7:37: error: expected unqualified-id before ')' token ofstream fout("harta3.out"); ^ harta3.cpp: In function 'int main()': harta3.cpp:18:3: error: 'fin' was not declared in this scope fin>>n; ^ harta3.cpp:18:7: error: 'gt' was not declared in this scope fin>>n; ^ harta3.cpp:18:15: warning: statement has no effect [-Wunused-value] fin>>n; ^ harta3.cpp:19:13: error: 'lt' was not declared in this scope for(i=1;i<=n;i++) ^ harta3.cpp:19:16: error: expected primary-expression before '=' token for(i=1;i<=n;i++) ^ harta3.cpp:19:18: error: expected ')' before ';' token for(i=1;i<=n;i++) ^ harta3.cpp:19:22: error: expected ';' before ')' token for(i=1;i<=n;i++) ^ harta3.cpp:20:29: warning: statement has no effect [-Wunused-value] fin>>x[i]>>y[i]; ^ harta3.cpp:21:13: error: 'lt' was not declared in this scope for(i=1;i<n;i++) ^ harta3.cpp:21:16: warning: for increment expression has no effect [-Wunused-value] for(i=1;i<n;i++) ^ harta3.cpp:21:17: error: expected ')' before ';' token for(i=1;i<n;i++) ^ harta3.cpp:21:21: error: expected ';' before ')' token for(i=1;i<n;i++) ^ harta3.cpp:22:16: error: 'lt' was not declared in this scope for(j=i+1;j<=n;j++) ^ harta3.cpp:22:19: error: expected primary-expression before '=' token for(j=i+1;j<=n;j++) ^ harta3.cpp:22:25: error: expected ';' before ')' token for(j=i+1;j<=n;j++) ^ harta3.cpp:28:16: error: expected primary-expression before '=' token for(i=1;i<=m;i++) ^ harta3.cpp:28:18: error: expected ')' before ';' token for(i=1;i<=m;i++) ^ harta3.cpp:28:22: error: expected ';' before ')' token for(i=1;i<=m;i++) ^ harta3.cpp:29:19: error: expected primary-expression before '=' token for(j=i+1;j<=m;j++) ^ harta3.cpp:29:25: error: expected ';' before ')' token for(j=i+1;j<=m;j++) ^ harta3.cpp:30:30: error: expected ';' before ')' token if(M[i].cost>M[j].cost) ^ harta3.cpp:31:25: warning: statement has no effect [-Wunused-value] swap(M[i], M[j]); ^ harta3.cpp:32:16: error: expected primary-expression before '=' token for(i=1;i<=n;i++) ^ harta3.cpp:32:18: error: expected ')' before ';' token for(i=1;i<=n;i++) ^ harta3.cpp:32:22: error: expected ';' before ')' token for(i=1;i<=n;i++) ^ harta3.cpp:35:18: error: expected primary-expression before '=' token for(i=1;i<=m;i++) ^ harta3.cpp:35:20: error: expected ')' before ';' token for(i=1;i<=m;i++) ^ harta3.cpp:35:24: error: expected ';' before ')' token for(i=1;i<=m;i++) ^ harta3.cpp:45:3: error: 'fout' was not declared in this scope fout<<setprecision(4)<<fixed<<S; ^ harta3.cpp:45:29: error: 'setprecision' was not declared in this scope fout<<setprecision(4)<<fixed<<S; ^ harta3.cpp:45:38: error: 'fixed' was not declared in this scope fout<<setprecision(4)<<fixed<<S; ^ harta3.cpp:45:52: warning: statement has no effect [-Wunused-value] fout<<setprecision(4)<<fixed<<S; ^ harta3.cpp:17:13: warning: unused variable 'k' [-Wunused-variable] int i, j, 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ă.