#3277
Se consideră o matrice cu N
linii și N
coloane, numerotate de la 1
la N
, care memorează doar valori 0
și 1
. Se dau de asemenea coordonatele a trei componente din această matrice. Să se determine lungimea minimă a unui drum care pleacă din poziția (1,1)
, trece obligatoriu prin cele trei componente date (nu contează în ce ordine) și apoi ajunge în poziția (N, N)
, drum care trece doar prin componente marcate cu 0
și învecinate pe linii și coloane.
Problema | Lee | Operații I/O |
![]() |
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #56074398 | Utilizator | |
Fișier | lee.cpp | Dimensiune | 2.11 KB |
Data încărcării | 04 Februarie 2025, 21:06 | Scor / rezultat | Eroare de compilare |
lee.cpp:4:20: error: too many initializers for 'int [3]' int dx[3]={1,0,-1,0}; ^ lee.cpp:5:20: error: too many initializers for 'int [3]' int dy[3]={0,-1,0,1}; ^ lee.cpp:8:1: error: 'queue' does not name a type queue<pair<int, int>> q; ^ lee.cpp: In function 'void lee(int, int, int (*)[105])': lee.cpp:27:5: error: 'q' was not declared in this scope q.push({x, y}); ^ lee.cpp:31:19: error: 'first' was not declared in this scope i=q.first(first); j=q.last(second); ^ lee.cpp:31:36: error: 'second' was not declared in this scope i=q.first(first); j=q.last(second); ^ lee.cpp:37:18: error: invalid types 'int [105][105][int [3]]' for array subscript a[dx][dy]=a[i][j]+1; ^ lee.cpp: In function 'void citire()': lee.cpp:45:5: error: 'cin' was not declared in this scope cin>>n; ^ lee.cpp:45:5: note: suggested alternative: In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0, from lee.cpp:1: /usr/include/c++/4.8/iostream:60:18: note: 'std::cin' extern istream cin; /// Linked to standard input ^ lee.cpp:46:16: error: invalid types 'int[int]' for array subscript cin>>A[1][1]; ^ lee.cpp:47:16: error: invalid types 'int[int]' for array subscript cin>>A[2][2]; ^ lee.cpp:48:16: error: invalid types 'int[int]' for array subscript cin>>A[3][3]; ^ lee.cpp: In function 'int final()': lee.cpp:57:30: error: 'A' was not declared in this scope M = min(M, d1[1][1] + d1[A[2].first][A[2].second] + ^ lee.cpp:58:51: error: 'min' was not declared in this scope d3[A[2].first][A[2].second] + d3[n][n]); ^ lee.cpp:58:51: note: suggested alternative: In file included from /usr/include/c++/4.8/algorithm:62:0, from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:64, from lee.cpp:1: /usr/include/c++/4.8/bits/stl_algo.h:4226:5: note: 'std::min' min(initializer_list<_Tp> __l, _Compare __comp) ^ lee.cpp:74:5: error: 'cout' was not declared in this scope cout << M; ^ lee.cpp:74:5: note: suggested alternative: In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0, from lee.cpp:1: /usr/include/c++/4.8/iostream:61:18: note: 'std::cout' extern ostream cout; /// Linked to standard output ^ lee.cpp:75:1: warning: no return statement in function returning non-void [-Wreturn-type] } ^ lee.cpp: In function 'int main()': lee.cpp:78:12: error: 'Citire' was not declared in this scope Citire(); ^ lee.cpp:79:13: error: 'Bordare' was not declared in this scope Bordare(); ^ lee.cpp:81:9: error: 'A' was not declared in this scope Lee(A[1].first, A[1].second, d1); ^ lee.cpp:81:36: error: 'Lee' was not declared in this scope Lee(A[1].first, A[1].second, d1); ^ lee.cpp: At global scope: lee.cpp:89:1: error: expected declaration before '}' token } ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Lee 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ă.