#146
graph
Călinuţa tocmai a găsit o foaie de hârtie pe care este desenat un graf orientat aciclic cu N
noduri şi M
arce, fiecare arc având o distanţă de valoare întreagă. Dându-se N
, M
şi cele M
arce cu distanţele dintre ele, trebuie să calculaţi pentru Călinuţa distanţa minimă dintre fiecare două noduri.
Grigore Moisil 2013
Problema | graph | Operații I/O |
graph.in /graph.out
|
---|---|---|---|
Limita timp | 1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #44439038 | Utilizator | |
Fișier | graph.cpp | Dimensiune | 1.99 KB |
Data încărcării | 20 August 2023, 12:10 | Scor / rezultat | Eroare de compilare |
graph.cpp:97:16: warning: missing terminating " character [enabled by default] printf(" ^ graph.cpp:97:9: error: missing terminating " character printf(" ^ graph.cpp:98:1: warning: missing terminating " character [enabled by default] "); ^ graph.cpp:98:1: error: missing terminating " character graph.cpp: In function 'void sort()': graph.cpp:61:9: error: reference to 'hash' is ambiguous hash[node] = i; ^ graph.cpp:14:5: note: candidates are: int hash [1513] int hash[nMax]; ^ In file included from /usr/include/c++/4.8/bits/stl_bvector.h:1134:0, from /usr/include/c++/4.8/vector:65, from graph.cpp:3: /usr/include/c++/4.8/bits/functional_hash.h:58:12: note: template<class _Tp> struct std::hash struct hash; ^ graph.cpp: In function 'void solve()': graph.cpp:76:22: error: reference to 'hash' is ambiguous for (int j = hash[i+1]; j < n; ++j) { ^ graph.cpp:14:5: note: candidates are: int hash [1513] int hash[nMax]; ^ In file included from /usr/include/c++/4.8/bits/stl_bvector.h:1134:0, from /usr/include/c++/4.8/vector:65, from graph.cpp:3: /usr/include/c++/4.8/bits/functional_hash.h:58:12: note: template<class _Tp> struct std::hash struct hash; ^ In file included from /usr/include/c++/4.8/cassert:43:0, from graph.cpp:2: graph.cpp:84:27: error: reference to 'hash' is ambiguous assert(j < hash[v[node][k].first]); ^ graph.cpp:14:5: note: candidates are: int hash [1513] int hash[nMax]; ^ In file included from /usr/include/c++/4.8/bits/stl_bvector.h:1134:0, from /usr/include/c++/4.8/vector:65, from graph.cpp:3: /usr/include/c++/4.8/bits/functional_hash.h:58:12: note: template<class _Tp> struct std::hash struct hash; ^ graph.cpp:100:5: error: expected primary-expression before '}' token } ^ graph.cpp:100:5: error: expected ';' before '}' token graph.cpp: In function 'void read()': graph.cpp:20:27: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result] scanf("%d %d", &n, &m); ^ graph.cpp:24:38: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result] scanf("%d %d %d", &x, &y, &z); ^ graph.cpp: In function 'int main()': graph.cpp:104:32: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)', declared with attribute warn_unused_result [-Wunused-result] freopen(infile, "r", stdin); ^ graph.cpp:105:34: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)', declared with attribute warn_unused_result [-Wunused-result] freopen(outfile, "w", stdout); ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema graph 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ă.