#1337
Susan
C++
Eroul nostru Susan se află într-un turn de formă cubică, de latură n
. El dorește să ajungă la comoara ascunsă în interiorul turnului. Din fericire, Susan a făcut rost de o hartă care îi indică cu exactitate coordonatele locului în care se află comoara din turn. Eroul nostru vrea să știe care este distanța minimă pe care o poate parcurge pentru a ajunge la comoară.
Problema | Susan | Operații I/O |
turn.in /turn.out
|
---|---|---|---|
Limita timp | 0.2 secunde | Limita memorie |
Total: 32 MB
/
Stivă 8 MB
|
Id soluție | #55078462 | Utilizator | |
Fișier | susan.cpp | Dimensiune | 2.81 KB |
Data încărcării | 20 Decembrie 2024, 22:38 | Scor / rezultat | Eroare de compilare |
susan.cpp:16:14: error: 'int y1' redeclared as different kind of symbol int n , x1 , y1 , z1 , x2 , y2 , z2 , m , p , qu , r; ^ In file included from /usr/include/features.h:374:0, from /usr/include/assert.h:35, from /usr/include/c++/4.8/cassert:43, from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:33, from susan.cpp:1: /usr/include/i386-linux-gnu/bits/mathcalls.h:241:1: error: previous declaration of 'double y1(double)' __MATHCALL (y1,, (_Mdouble_)); ^ susan.cpp: In function 'void lee()': susan.cpp:29:13: error: invalid types 'int [101][101][double(double)throw ()]' for array subscript b[x1][y1][z1]=1; ^ susan.cpp:31:20: error: invalid conversion from 'double (*)(double)throw ()' to 'int' [-fpermissive] r.i = x1 , r.j = y1 , r.k = z1; ^ susan.cpp: In function 'int main()': susan.cpp:84:5: error: reference to 'cin' is ambiguous cin >> n >> m >> p >> qu >> r; ^ susan.cpp:5:10: note: candidates are: std::ifstream cin ifstream cin("turn.in"); ^ In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0, from susan.cpp:1: /usr/include/c++/4.8/iostream:60:18: note: std::istream std::cin extern istream cin; /// Linked to standard input ^ susan.cpp:88:9: error: reference to 'cin' is ambiguous cin >> x >> y >> z; ^ susan.cpp:5:10: note: candidates are: std::ifstream cin ifstream cin("turn.in"); ^ In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0, from susan.cpp:1: /usr/include/c++/4.8/iostream:60:18: note: std::istream std::cin extern istream cin; /// Linked to standard input ^ susan.cpp:93:9: error: reference to 'cin' is ambiguous cin >> x >> y >> z; ^ susan.cpp:5:10: note: candidates are: std::ifstream cin ifstream cin("turn.in"); ^ In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0, from susan.cpp:1: /usr/include/c++/4.8/iostream:60:18: note: std::istream std::cin extern istream cin; /// Linked to standard input ^ susan.cpp:98:9: error: reference to 'cin' is ambiguous cin >> x >> y >> z; ^ susan.cpp:5:10: note: candidates are: std::ifstream cin ifstream cin("turn.in"); ^ In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0, from susan.cpp:1: /usr/include/c++/4.8/iostream:60:18: note: std::istream std::cin extern istream cin; /// Linked to standard input ^ susan.cpp:103:9: error: reference to 'cin' is ambiguous cin >> x >> y >> z; ^ susan.cpp:5:10: note: candidates are: std::ifstream cin ifstream cin("turn.in"); ^ In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0, from susan.cpp:1: /usr/include/c++/4.8/iostream:60:18: note: std::istream std::cin extern istream cin; /// Linked to standard input ^ susan.cpp:106:5: error: reference to 'cin' is ambiguous cin >> x1 >> y1 >> z1 >> x2 >> y2 >> z2; ^ susan.cpp:5:10: note: candidates are: std::ifstream cin ifstream cin("turn.in"); ^ In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0, from susan.cpp:1: /usr/include/c++/4.8/iostream:60:18: note: std::istream std::cin extern istream cin; /// Linked to standard input ^ susan.cpp:107:26: error: no matching function for call to 'std::queue<poz>::push(<brace-enclosed initializer list>)' q.push({x1 , y1 , z1}); ^ susan.cpp:107:26: note: candidates are: In file included from /usr/include/c++/4.8/queue:64:0, from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:85, from susan.cpp:1: /usr/include/c++/4.8/bits/stl_queue.h:212:7: note: void std::queue<_Tp, _Sequence>::push(const value_type&) [with _Tp = poz; _Sequence = std::deque<poz, std::allocator<poz> >; std::queue<_Tp, _Sequence>::value_type = poz] push(const value_type& __x) ^ /usr/include/c++/4.8/bits/stl_queue.h:212:7: note: no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'const value_type& {aka const poz&}' /usr/include/c++/4.8/bits/stl_queue.h:217:7: note: void std::queue<_Tp, _Sequence>::push(std::queue<_Tp, _Sequence>::value_type&&) [with _Tp = poz; _Sequence = std::deque<poz, std::allocator<poz> >; std::queue<_Tp, _Sequence>::value_type = poz] push(value_type&& __x) ^ /usr/include/c++/4.8/bits/stl_queue.h:217:7: note: no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'std::queue<poz>::value_type&& {aka poz&&}' susan.cpp:109:5: error: reference to 'cout' is ambiguous cout << b[x2][y2][z2]; ^ susan.cpp:6:10: note: candidates are: std::ofstream cout ofstream cout("turn.out"); ^ In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0, from susan.cpp:1: /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 Susan 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ă.