#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 | #51503767 | Utilizator | |
Fișier | graph.cpp | Dimensiune | 1.99 KB |
Data încărcării | 30 Iunie 2024, 13:35 | Scor / rezultat | Eroare de compilare |
graph.cpp:21:11: warning: missing terminating " character [enabled by default] scanf("%d %d ^ graph.cpp:21:5: error: missing terminating " character scanf("%d %d ^ graph.cpp:22:1: warning: missing terminating " character [enabled by default] ", &n, &m); ^ graph.cpp:22:1: error: missing terminating " character graph.cpp:99:16: warning: missing terminating " character [enabled by default] printf(" ^ graph.cpp:99:9: error: missing terminating " character printf(" ^ graph.cpp:100:1: warning: missing terminating " character [enabled by default] "); ^ graph.cpp:100:1: error: missing terminating " character graph.cpp: In function 'void read()': graph.cpp:24:5: error: expected primary-expression before 'for' for (int i = 0; i < m; ++i) { ^ graph.cpp:24:21: error: 'i' was not declared in this scope for (int i = 0; i < m; ++i) { ^ graph.cpp:24:31: error: expected ';' before ')' token for (int i = 0; i < m; ++i) { ^ graph.cpp: In function 'void sort()': graph.cpp:63:9: error: reference to 'hash' is ambiguous hash[node] = i; ^ graph.cpp:15: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:78:22: error: reference to 'hash' is ambiguous for (int j = hash[i+1]; j < n; ++j) { ^ graph.cpp:15: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:86:27: error: reference to 'hash' is ambiguous assert(j < hash[v[node][k].first]); ^ graph.cpp:15: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:102:5: error: expected primary-expression before '}' token } ^ graph.cpp:102:5: error: expected ';' before '}' token graph.cpp: In function 'int main()': graph.cpp:106: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:107: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ă.