#2933
TollRoads
N
oraşe sunt conectate între ele prin M
autostrăzi bidirecţionale, fiecare autostradă (a, b)
având un cost de tranzit c
ataşat. Se doreşte revizuirea sistemului de taxare, însă sunt câteva aspecte ce trebuie luate în calcul şi necesită investigaţie, deoarece o parte dintre cele N
oraşe sunt centre comerciale sau turistice importante. Se doreşte să se afle răspunsul la o serie de Q
întrebări de forma: (X, T)
– câte dintre celelalte N-1
oraşe au acces către oraşul X
, cu o taxă totală de cel mult T
către fiecare oraş?
Info Oltenia 2019
Problema | TollRoads | Operații I/O |
![]() tollroads.in /tollroads.out
|
---|---|---|---|
Limita timp | 1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #51178821 | Utilizator | |
Fișier | tollroads.cpp | Dimensiune | 1.00 KB |
Data încărcării | 28 Mai 2024, 18:03 | Scor / rezultat | Eroare de compilare |
tollroads.cpp:4:13: error: variable 'std::ifstream cin' has initializer but incomplete type ifstream cin("tollroads.in"); ^ tollroads.cpp:5:14: error: variable 'std::ofstream cout' has initializer but incomplete type ofstream cout("tollroads.out"); ^ tollroads.cpp:7:1: error: 'vector' does not name a type vector<vector<pair<int, int>>> G(100001); ^ tollroads.cpp: In function 'int BFS(int)': tollroads.cpp:9:5: error: 'queue' was not declared in this scope queue<int> Q; ^ tollroads.cpp:9:11: error: expected primary-expression before 'int' queue<int> Q; ^ tollroads.cpp:9:11: error: expected ';' before 'int' tollroads.cpp:10:5: error: 'Q' was not declared in this scope Q.push(nod); ^ tollroads.cpp:14:20: error: 'G' was not declared in this scope for(auto x:G[nod1]){ ^ tollroads.cpp: In function 'int main()': tollroads.cpp:30:5: error: reference to 'cin' is ambiguous cin >> n >> m >> k; ^ tollroads.cpp:4:10: note: candidates are: <typeprefixerror>cin ifstream cin("tollroads.in"); ^ In file included from tollroads.cpp:1:0: /usr/include/c++/4.8/iostream:60:18: note: std::istream std::cin extern istream cin; /// Linked to standard input ^ tollroads.cpp:33:9: error: reference to 'cin' is ambiguous cin >> a >> b >> c, G[a].push_back({b, c}), G[b].push_back({a, c}); ^ tollroads.cpp:4:10: note: candidates are: <typeprefixerror>cin ifstream cin("tollroads.in"); ^ In file included from tollroads.cpp:1:0: /usr/include/c++/4.8/iostream:60:18: note: std::istream std::cin extern istream cin; /// Linked to standard input ^ tollroads.cpp:33:29: error: 'G' was not declared in this scope cin >> a >> b >> c, G[a].push_back({b, c}), G[b].push_back({a, c}); ^ tollroads.cpp:37:9: error: reference to 'cin' is ambiguous cin >> X >> t; ^ tollroads.cpp:4:10: note: candidates are: <typeprefixerror>cin ifstream cin("tollroads.in"); ^ In file included from tollroads.cpp:1:0: /usr/include/c++/4.8/iostream:60:18: note: std::istream std::cin extern istream cin; /// Linked to standard input ^ tollroads.cpp:38:9: error: reference to 'cout' is ambiguous cout << BFS(X) << '\n'; ^ tollroads.cpp:5:10: note: candidates are: <typeprefixerror>cout ofstream cout("tollroads.out"); ^ In file included from tollroads.cpp:1:0: /usr/include/c++/4.8/iostream:61:18: note: std::ostream std::cout extern ostream cout; /// Linked to standard output ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema TollRoads 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ă.