#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 | #51758095 | Utilizator | |
Fișier | graph.cpp | Dimensiune | 2.03 KB |
Data încărcării | 14 August 2024, 20:20 | Scor / rezultat | Eroare de compilare |
graph.cpp:22:11: warning: missing terminating " character [enabled by default] scanf("%d %d ^ graph.cpp:22:5: error: missing terminating " character scanf("%d %d ^ graph.cpp:23:1: warning: missing terminating " character [enabled by default] ", &n, &m); ^ graph.cpp:23:1: error: missing terminating " character graph.cpp:100:16: warning: missing terminating " character [enabled by default] printf(" ^ graph.cpp:100:9: error: missing terminating " character printf(" ^ graph.cpp:101:1: warning: missing terminating " character [enabled by default] "); ^ graph.cpp:101:1: error: missing terminating " character graph.cpp: In function 'void read()': graph.cpp:25:5: error: expected primary-expression before 'for' for (int i = 0; i < m; ++i) { ^ graph.cpp:25:21: error: 'i' was not declared in this scope for (int i = 0; i < m; ++i) { ^ graph.cpp:25:31: error: expected ';' before ')' token for (int i = 0; i < m; ++i) { ^ graph.cpp: In function 'void sort()': graph.cpp:64:9: error: reference to 'hash' is ambiguous hash[node] = i; ^ graph.cpp:16: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:4: /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:79:22: error: reference to 'hash' is ambiguous for (int j = hash[i+1]; j < n; ++j) { ^ graph.cpp:16: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:4: /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:3: graph.cpp:87:27: error: reference to 'hash' is ambiguous assert(j < hash[v[node][k].first]); ^ graph.cpp:16: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:4: /usr/include/c++/4.8/bits/functional_hash.h:58:12: note: template<class _Tp> struct std::hash struct hash; ^ graph.cpp:103:5: error: expected primary-expression before '}' token } ^ graph.cpp:103:5: error: expected ';' before '}' token graph.cpp: In function 'int main()': graph.cpp:107: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:108: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ă.