#4061
LantQ
Se dă un graf neorientat cu n vârfuri și un număr natural q
. Să se determine toate lanțurile elementare formate din cel puțin o muchie, cu extremitatea finală în vârful q
.
Problema | LantQ | Operații I/O |
lantq.in /lantq.out
|
---|---|---|---|
Limita timp | 0.4 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #54149675 | Utilizator | |
Fișier | lantq.cpp | Dimensiune | 1.78 KB |
Data încărcării | 20 Noiembrie 2024, 20:05 | Scor / rezultat | Eroare de compilare |
lantq.cpp:10:1: error: stray '\310' in program void dfs(int nod, int q, vector<vector<int>>& graf, vector<bool>& vizitat, vector<int>& lanț, set<vector<int>>& lanțuri) { ^ lantq.cpp:10:1: error: stray '\233' in program lantq.cpp:10:1: error: stray '\310' in program lantq.cpp:10:1: error: stray '\233' in program lantq.cpp:12:5: error: stray '\310' in program lanț.push_back(nod); ^ lantq.cpp:12:5: error: stray '\233' in program lantq.cpp:14:5: error: stray '\310' in program if (nod == q && lanț.size() > 1) { // Verificăm că lanțul nu este doar q ^ lantq.cpp:14:5: error: stray '\233' in program lantq.cpp:15:9: error: stray '\310' in program lanțuri.insert(lanț); // Adăugăm lanțul la mulțimea de lanțuri ^ lantq.cpp:15:9: error: stray '\233' in program lantq.cpp:15:9: error: stray '\310' in program lantq.cpp:15:9: error: stray '\233' in program lantq.cpp:20:13: error: stray '\310' in program dfs(vecin, q, graf, vizitat, lanț, lanțuri); ^ lantq.cpp:20:13: error: stray '\233' in program lantq.cpp:20:13: error: stray '\310' in program lantq.cpp:20:13: error: stray '\233' in program lantq.cpp:25:5: error: stray '\310' in program lanț.pop_back(); ^ lantq.cpp:25:5: error: stray '\233' in program lantq.cpp:49:5: error: stray '\310' in program set<vector<int>> lanțuri; // Folosim un set pentru a elimina duplicatele și pentru a sorta automat ^ lantq.cpp:49:5: error: stray '\233' in program lantq.cpp:53:9: error: stray '\310' in program vector<int> lanț; ^ lantq.cpp:53:9: error: stray '\233' in program lantq.cpp:54:9: error: stray '\310' in program dfs(vecin, q, graf, vizitat, lanț, lanțuri); ^ lantq.cpp:54:9: error: stray '\233' in program lantq.cpp:54:9: error: stray '\310' in program lantq.cpp:54:9: error: stray '\233' in program lantq.cpp:58:5: error: stray '\310' in program if (!lanțuri.empty()) { ^ lantq.cpp:58:5: error: stray '\233' in program lantq.cpp:59:9: error: stray '\310' in program for (const auto& lanț : lanțuri) { ^ lantq.cpp:59:9: error: stray '\233' in program lantq.cpp:59:9: error: stray '\310' in program lantq.cpp:59:9: error: stray '\233' in program lantq.cpp:60:13: error: stray '\310' in program for (size_t i = 0; i < lanț.size(); i++) { ^ lantq.cpp:60:13: error: stray '\233' in program lantq.cpp:61:17: error: stray '\310' in program fout << lanț[i] << (i == lanț.size() - 1 ? "\n" : " "); ^ lantq.cpp:61:17: error: stray '\233' in program lantq.cpp:61:17: error: stray '\310' in program lantq.cpp:61:17: error: stray '\233' in program lantq.cpp:10:114: error: conflicting declaration 'std::set<std::vector<int> >& lan' void dfs(int nod, int q, vector<vector<int>>& graf, vector<bool>& vizitat, vector<int>& lanț, set<vector<int>>& lanțuri) { ^ lantq.cpp:10:89: error: 'lan' has a previous declaration as 'std::vector<int>& lan' void dfs(int nod, int q, vector<vector<int>>& graf, vector<bool>& vizitat, vector<int>& lanț, set<vector<int>>& lanțuri) { ^ lantq.cpp:10:119: error: expected ',' or '...' before 'uri' void dfs(int nod, int q, vector<vector<int>>& graf, vector<bool>& vizitat, vector<int>& lanț, set<vector<int>>& lanțuri) { ^ lantq.cpp: In function 'void dfs(int, int, std::vector<std::vector<int> >&, std::vector<bool>&, std::vector<int>&)': lantq.cpp:15:14: error: expected ';' before 'uri' lanțuri.insert(lanț); // Adăugăm lanțul la mulțimea de lanțuri ^ lantq.cpp:15:31: warning: statement has no effect [-Wunused-value] lanțuri.insert(lanț); // Adăugăm lanțul la mulțimea de lanțuri ^ lantq.cpp:20:54: error: expected ')' before 'uri' dfs(vecin, q, graf, vizitat, lanț, lanțuri); ^ lantq.cpp:20:57: error: too many arguments to function 'void dfs(int, int, std::vector<std::vector<int> >&, std::vector<bool>&, std::vector<int>&)' dfs(vecin, q, graf, vizitat, lanț, lanțuri); ^ lantq.cpp:10:6: note: declared here void dfs(int nod, int q, vector<vector<int>>& graf, vector<bool>& vizitat, vector<int>& lanț, set<vector<int>>& lanțuri) { ^ lantq.cpp: In function 'int main()': lantq.cpp:49:27: error: expected initializer before 'uri' set<vector<int>> lanțuri; // Folosim un set pentru a elimina duplicatele și pentru a sorta automat ^ lantq.cpp:54:50: error: expected ')' before 'uri' dfs(vecin, q, graf, vizitat, lanț, lanțuri); ^ lantq.cpp:54:53: error: too many arguments to function 'void dfs(int, int, std::vector<std::vector<int> >&, std::vector<bool>&, std::vector<int>&)' dfs(vecin, q, graf, vizitat, lanț, lanțuri); ^ lantq.cpp:10:6: note: declared here void dfs(int nod, int q, vector<vector<int>>& graf, vector<bool>& vizitat, vector<int>& lanț, set<vector<int>>& lanțuri) { ^ lantq.cpp:58:10: error: 'lan' was not declared in this scope if (!lanțuri.empty()) { ^ lantq.cpp:58:15: error: expected ')' before 'uri' if (!lanțuri.empty()) { ^ lantq.cpp:59:34: error: use of 'lan' before deduction of 'auto' for (const auto& lanț : lanțuri) { ^ lantq.cpp:59:39: error: expected ')' before 'uri' for (const auto& lanț : lanțuri) { ^ lantq.cpp:59:39: error: 'uri' was not declared in this scope lantq.cpp:59:42: error: expected ';' before ')' token for (const auto& lanț : lanțuri) { ^ lantq.cpp:69:1: error: expected '}' at end of input } ^ lantq.cpp:69:1: error: expected '}' at end of input
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema LantQ 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ă.