#3156
perm_min_max
Se citește o mulțime cu n
numere naturale. Afișați în ordine lexicografică toate permutările mulțimii citite în care elementul minim și cel maxim nu își schimbă poziția.
Problema | perm_min_max | Operații I/O | tastatură/ecran |
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #53381962 | Utilizator | |
Fișier | perm_min_max.cpp | Dimensiune | 1.52 KB |
Data încărcării | 27 Octombrie 2024, 11:08 | Scor / rezultat | Eroare de compilare |
perm_min_max.cpp: In function 'void bkt(int)': perm_min_max.cpp:26:10: error: expected ')' before 'v' v[k]=x[i]; ^ perm_min_max.cpp: In function 'int main()': perm_min_max.cpp:59:23: error: reference to 'max' is ambiguous if(x[i]>max) ^ perm_min_max.cpp:3:20: note: candidates are: long int max long int v[11],min,max,n,x[11],imin=999999999,imax=0; ^ In file included from /usr/include/c++/4.8/bits/char_traits.h:39:0, from /usr/include/c++/4.8/ios:40, from /usr/include/c++/4.8/ostream:38, from /usr/include/c++/4.8/iostream:39, from perm_min_max.cpp:1: /usr/include/c++/4.8/bits/stl_algobase.h:260:5: note: template<class _Tp, class _Compare> const _Tp& std::max(const _Tp&, const _Tp&, _Compare) max(const _Tp& __a, const _Tp& __b, _Compare __comp) ^ /usr/include/c++/4.8/bits/stl_algobase.h:216:5: note: template<class _Tp> const _Tp& std::max(const _Tp&, const _Tp&) max(const _Tp& __a, const _Tp& __b) ^ perm_min_max.cpp:60:17: error: reference to 'max' is ambiguous { max=x[i]; ^ perm_min_max.cpp:3:20: note: candidates are: long int max long int v[11],min,max,n,x[11],imin=999999999,imax=0; ^ In file included from /usr/include/c++/4.8/bits/char_traits.h:39:0, from /usr/include/c++/4.8/ios:40, from /usr/include/c++/4.8/ostream:38, from /usr/include/c++/4.8/iostream:39, from perm_min_max.cpp:1: /usr/include/c++/4.8/bits/stl_algobase.h:260:5: note: template<class _Tp, class _Compare> const _Tp& std::max(const _Tp&, const _Tp&, _Compare) max(const _Tp& __a, const _Tp& __b, _Compare __comp) ^ /usr/include/c++/4.8/bits/stl_algobase.h:216:5: note: template<class _Tp> const _Tp& std::max(const _Tp&, const _Tp&) max(const _Tp& __a, const _Tp& __b) ^ perm_min_max.cpp:63:23: error: reference to 'min' is ambiguous if(x[i]<min) ^ perm_min_max.cpp:3:16: note: candidates are: long int min long int v[11],min,max,n,x[11],imin=999999999,imax=0; ^ In file included from /usr/include/c++/4.8/bits/char_traits.h:39:0, from /usr/include/c++/4.8/ios:40, from /usr/include/c++/4.8/ostream:38, from /usr/include/c++/4.8/iostream:39, from perm_min_max.cpp:1: /usr/include/c++/4.8/bits/stl_algobase.h:239:5: note: template<class _Tp, class _Compare> const _Tp& std::min(const _Tp&, const _Tp&, _Compare) min(const _Tp& __a, const _Tp& __b, _Compare __comp) ^ /usr/include/c++/4.8/bits/stl_algobase.h:193:5: note: template<class _Tp> const _Tp& std::min(const _Tp&, const _Tp&) min(const _Tp& __a, const _Tp& __b) ^ perm_min_max.cpp:65:19: error: reference to 'min' is ambiguous min=x[i]; ^ perm_min_max.cpp:3:16: note: candidates are: long int min long int v[11],min,max,n,x[11],imin=999999999,imax=0; ^ In file included from /usr/include/c++/4.8/bits/char_traits.h:39:0, from /usr/include/c++/4.8/ios:40, from /usr/include/c++/4.8/ostream:38, from /usr/include/c++/4.8/iostream:39, from perm_min_max.cpp:1: /usr/include/c++/4.8/bits/stl_algobase.h:239:5: note: template<class _Tp, class _Compare> const _Tp& std::min(const _Tp&, const _Tp&, _Compare) min(const _Tp& __a, const _Tp& __b, _Compare __comp) ^ /usr/include/c++/4.8/bits/stl_algobase.h:193:5: note: template<class _Tp> const _Tp& std::min(const _Tp&, const _Tp&) min(const _Tp& __a, const _Tp& __b) ^ perm_min_max.cpp:69:22: error: invalid conversion from 'long int*' to 'int*' [-fpermissive] QS(x,1,n); ^ perm_min_max.cpp:32:8: error: initializing argument 1 of 'void QS(int*, int, int)' [-fpermissive] void QS(int a[],int st,int dr) ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema perm_min_max 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ă.