#1887
Dijkstra2
Dijkstra are nevoie de ajutorul vostru pentru a-și duce la bun sfârșit datoria. Acesta vrea să afle drumurile de lungime minimă de la casa prietenului său Vlad la celelalte case ale vecinilor. Nu are foarte mult timp la dispoziție așa ca trebuie să vă mișcați repede. Îl veți ajuta?
Problema | Dijkstra2 | Operații I/O |
dijkstra2.in /dijkstra2.out
|
---|---|---|---|
Limita timp | 0.2 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #54923812 | Utilizator | |
Fișier | dijkstra2.cpp | Dimensiune | 1.49 KB |
Data încărcării | 12 Decembrie 2024, 12:10 | Scor / rezultat | Eroare de compilare |
dijkstra2.cpp:1:5: error: stray '#' in program 1887#include <bits/stdc++.h> ^ dijkstra2.cpp:1:1: error: expected unqualified-id before numeric constant 1887#include <bits/stdc++.h> ^ dijkstra2.cpp:4:1: error: 'ifstream' does not name a type ifstream fin("dijkstra2.in"); ^ dijkstra2.cpp:5:1: error: 'ofstream' does not name a type ofstream fout("dijkstra2.out"); ^ dijkstra2.cpp:8:1: error: 'vector' does not name a type vector<vector<pair<int,int>>>a; ^ dijkstra2.cpp:9:1: error: 'vector' does not name a type vector<int>d; ^ dijkstra2.cpp:10:1: error: 'vector' does not name a type vector<bool>incoada; ^ dijkstra2.cpp: In function 'void Dijkstra(int)': dijkstra2.cpp:13:5: error: 'd' was not declared in this scope d=vector<int>(n+1,inf); ^ dijkstra2.cpp:13:7: error: 'vector' was not declared in this scope d=vector<int>(n+1,inf); ^ dijkstra2.cpp:13:14: error: expected primary-expression before 'int' d=vector<int>(n+1,inf); ^ dijkstra2.cpp:13:14: error: expected ';' before 'int' dijkstra2.cpp:14:5: error: 'incoada' was not declared in this scope incoada=vector<bool>(n+1,false); ^ dijkstra2.cpp:14:20: error: expected primary-expression before 'bool' incoada=vector<bool>(n+1,false); ^ dijkstra2.cpp:14:20: error: expected ';' before 'bool' dijkstra2.cpp:15:5: error: 'priority_queue' was not declared in this scope priority_queue<pair<int,int>,vector<pair<int,int>>,greater<pair<int,int>>>q;//spre deosebire de citire, primul element va fi costul iar al doilea nodul ^ dijkstra2.cpp:15:20: error: 'pair' was not declared in this scope priority_queue<pair<int,int>,vector<pair<int,int>>,greater<pair<int,int>>>q;//spre deosebire de citire, primul element va fi costul iar al doilea nodul ^ dijkstra2.cpp:15:25: error: expected primary-expression before 'int' priority_queue<pair<int,int>,vector<pair<int,int>>,greater<pair<int,int>>>q;//spre deosebire de citire, primul element va fi costul iar al doilea nodul ^ dijkstra2.cpp:15:25: error: expected ';' before 'int' dijkstra2.cpp:17:5: error: 'q' was not declared in this scope q.push({0,k}); ^ dijkstra2.cpp:25:23: error: 'a' was not declared in this scope for(int i=0;i<a[nodcurr].size();i++) ^ dijkstra2.cpp:22:13: warning: unused variable 'dist' [-Wunused-variable] int dist=q.top().first; ^ dijkstra2.cpp: In function 'int main()': dijkstra2.cpp:43:5: error: 'fin' was not declared in this scope fin>>n>>m>>p; ^ dijkstra2.cpp:44:5: error: 'a' was not declared in this scope a=vector<vector<pair<int,int>>>(n+1); ^ dijkstra2.cpp:44:7: error: 'vector' was not declared in this scope a=vector<vector<pair<int,int>>>(n+1); ^ dijkstra2.cpp:44:21: error: 'pair' was not declared in this scope a=vector<vector<pair<int,int>>>(n+1); ^ dijkstra2.cpp:44:26: error: expected primary-expression before 'int' a=vector<vector<pair<int,int>>>(n+1); ^ dijkstra2.cpp:44:26: error: expected ';' before 'int' dijkstra2.cpp:55:12: error: 'd' was not declared in this scope if(d[i]==inf) ^ dijkstra2.cpp:56:13: error: 'fout' was not declared in this scope fout<<-1<<" "; ^ dijkstra2.cpp:58:9: error: 'fout' was not declared in this scope fout<<d[i]<<" "; ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Dijkstra2 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ă.