#211
Spirala
Să se parcurgă o matrice pătratică în spirală în sensul acelor de ceasornic.
Problema | Spirala | Operații I/O |
![]() spirala.in /spirala.out
|
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #51515059 | Utilizator | |
Fișier | spirala.cpp | Dimensiune | 1.10 KB |
Data încărcării | 02 Iulie 2024, 22:17 | Scor / rezultat | Eroare de compilare |
spirala.cpp: In function 'int main()': spirala.cpp:19:29: error: reference to 'left' is ambiguous while (top <= bottom && left <= right) { ^ spirala.cpp:8:40: note: candidates are: int left int n, top = 1, right = n, bottom = n, left = 1, value = 1, a[25][25]; ^ In file included from /usr/include/c++/4.8/ios:42:0, from /usr/include/c++/4.8/ostream:38, from /usr/include/c++/4.8/iostream:39, from spirala.cpp:1: /usr/include/c++/4.8/bits/ios_base.h:922:3: note: std::ios_base& std::left(std::ios_base&) left(ios_base& __base) ^ spirala.cpp:19:37: error: reference to 'right' is ambiguous while (top <= bottom && left <= right) { ^ spirala.cpp:8:17: note: candidates are: int right int n, top = 1, right = n, bottom = n, left = 1, value = 1, a[25][25]; ^ In file included from /usr/include/c++/4.8/ios:42:0, from /usr/include/c++/4.8/ostream:38, from /usr/include/c++/4.8/iostream:39, from spirala.cpp:1: /usr/include/c++/4.8/bits/ios_base.h:930:3: note: std::ios_base& std::right(std::ios_base&) right(ios_base& __base) ^ spirala.cpp:20:22: error: reference to 'left' is ambiguous for (int i = left; left <= right; i++) { ^ spirala.cpp:8:40: note: candidates are: int left int n, top = 1, right = n, bottom = n, left = 1, value = 1, a[25][25]; ^ In file included from /usr/include/c++/4.8/ios:42:0, from /usr/include/c++/4.8/ostream:38, from /usr/include/c++/4.8/iostream:39, from spirala.cpp:1: /usr/include/c++/4.8/bits/ios_base.h:922:3: note: std::ios_base& std::left(std::ios_base&) left(ios_base& __base) ^ spirala.cpp:20:28: error: reference to 'left' is ambiguous for (int i = left; left <= right; i++) { ^ spirala.cpp:8:40: note: candidates are: int left int n, top = 1, right = n, bottom = n, left = 1, value = 1, a[25][25]; ^ In file included from /usr/include/c++/4.8/ios:42:0, from /usr/include/c++/4.8/ostream:38, from /usr/include/c++/4.8/iostream:39, from spirala.cpp:1: /usr/include/c++/4.8/bits/ios_base.h:922:3: note: std::ios_base& std::left(std::ios_base&) left(ios_base& __base) ^ spirala.cpp:20:36: error: reference to 'right' is ambiguous for (int i = left; left <= right; i++) { ^ spirala.cpp:8:17: note: candidates are: int right int n, top = 1, right = n, bottom = n, left = 1, value = 1, a[25][25]; ^ In file included from /usr/include/c++/4.8/ios:42:0, from /usr/include/c++/4.8/ostream:38, from /usr/include/c++/4.8/iostream:39, from spirala.cpp:1: /usr/include/c++/4.8/bits/ios_base.h:930:3: note: std::ios_base& std::right(std::ios_base&) right(ios_base& __base) ^ spirala.cpp:26:15: error: reference to 'right' is ambiguous a[i][right] = value++; ^ spirala.cpp:8:17: note: candidates are: int right int n, top = 1, right = n, bottom = n, left = 1, value = 1, a[25][25]; ^ In file included from /usr/include/c++/4.8/ios:42:0, from /usr/include/c++/4.8/ostream:38, from /usr/include/c++/4.8/iostream:39, from spirala.cpp:1: /usr/include/c++/4.8/bits/ios_base.h:930:3: note: std::ios_base& std::right(std::ios_base&) right(ios_base& __base) ^ spirala.cpp:28:9: error: reference to 'right' is ambiguous right--; ^ spirala.cpp:8:17: note: candidates are: int right int n, top = 1, right = n, bottom = n, left = 1, value = 1, a[25][25]; ^ In file included from /usr/include/c++/4.8/ios:42:0, from /usr/include/c++/4.8/ostream:38, from /usr/include/c++/4.8/iostream:39, from spirala.cpp:1: /usr/include/c++/4.8/bits/ios_base.h:930:3: note: std::ios_base& std::right(std::ios_base&) right(ios_base& __base) ^ spirala.cpp:31:26: error: reference to 'right' is ambiguous for (int i = right; i >= left; i--) { ^ spirala.cpp:8:17: note: candidates are: int right int n, top = 1, right = n, bottom = n, left = 1, value = 1, a[25][25]; ^ In file included from /usr/include/c++/4.8/ios:42:0, from /usr/include/c++/4.8/ostream:38, from /usr/include/c++/4.8/iostream:39, from spirala.cpp:1: /usr/include/c++/4.8/bits/ios_base.h:930:3: note: std::ios_base& std::right(std::ios_base&) right(ios_base& __base) ^ spirala.cpp:31:38: error: reference to 'left' is ambiguous for (int i = right; i >= left; i--) { ^ spirala.cpp:8:40: note: candidates are: int left int n, top = 1, right = n, bottom = n, left = 1, value = 1, a[25][25]; ^ In file included from /usr/include/c++/4.8/ios:42:0, from /usr/include/c++/4.8/ostream:38, from /usr/include/c++/4.8/iostream:39, from spirala.cpp:1: /usr/include/c++/4.8/bits/ios_base.h:922:3: note: std::ios_base& std::left(std::ios_base&) left(ios_base& __base) ^ spirala.cpp:37:16: error: reference to 'left' is ambiguous while (left <= right) { ^ spirala.cpp:8:40: note: candidates are: int left int n, top = 1, right = n, bottom = n, left = 1, value = 1, a[25][25]; ^ In file included from /usr/include/c++/4.8/ios:42:0, from /usr/include/c++/4.8/ostream:38, from /usr/include/c++/4.8/iostream:39, from spirala.cpp:1: /usr/include/c++/4.8/bits/ios_base.h:922:3: note: std::ios_base& std::left(std::ios_base&) left(ios_base& __base) ^ spirala.cpp:37:24: error: reference to 'right' is ambiguous while (left <= right) { ^ spirala.cpp:8:17: note: candidates are: int right int n, top = 1, right = n, bottom = n, left = 1, value = 1, a[25][25]; ^ In file included from /usr/include/c++/4.8/ios:42:0, from /usr/include/c++/4.8/ostream:38, from /usr/include/c++/4.8/iostream:39, from spirala.cpp:1: /usr/include/c++/4.8/bits/ios_base.h:930:3: note: std::ios_base& std::right(std::ios_base&) right(ios_base& __base) ^ spirala.cpp:39:19: error: reference to 'left' is ambiguous a[i][left] = value++; ^ spirala.cpp:8:40: note: candidates are: int left int n, top = 1, right = n, bottom = n, left = 1, value = 1, a[25][25]; ^ In file included from /usr/include/c++/4.8/ios:42:0, from /usr/include/c++/4.8/ostream:38, from /usr/include/c++/4.8/iostream:39, from spirala.cpp:1: /usr/include/c++/4.8/bits/ios_base.h:922:3: note: std::ios_base& std::left(std::ios_base&) left(ios_base& __base) ^ spirala.cpp:41:13: error: reference to 'left' is ambiguous left++; ^ spirala.cpp:8:40: note: candidates are: int left int n, top = 1, right = n, bottom = n, left = 1, value = 1, a[25][25]; ^ In file included from /usr/include/c++/4.8/ios:42:0, from /usr/include/c++/4.8/ostream:38, from /usr/include/c++/4.8/iostream:39, from spirala.cpp:1: /usr/include/c++/4.8/bits/ios_base.h:922:3: note: std::ios_base& std::left(std::ios_base&) left(ios_base& __base) ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Spirala 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ă.