#2385
oaste
Pe un continent reprezentat printr-o matrice cu n
linii si m
coloane se aflá mai multe state, toate aflate in conflict. Astfel, fiecare si-a mobilizat oastea. Elementele matrici memoreazá cäte o cifrá. Doua elemente ínvecinate pe linie sau pe coloaná (nu si pe diagonalá) apartin aceluiasi stat si se numesc regiuni. O pozitie din matrice ce contine cifra 0
este o regiune neutra si nu are soldati, iar pozitia ce contine o cifra c
nenula apartine unui stat si are c
soldati. Determinati regiunea cu cei mai multi soldati din statul cu cei mai multi soldati.
Problema | oaste | Operații I/O |
oaste.in /oaste.out
|
---|---|---|---|
Limita timp | 0.05 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #9517667 | Utilizator | |
Fișier | oaste.cpp | Dimensiune | 897 B |
Data încărcării | 09 Mai 2018, 17:47 | Scor / rezultat | Eroare de compilare |
oaste.cpp: In function 'int main()': oaste.cpp:25:8: error: 'i' was not declared in this scope for(i=1;i<=n;i++) ^ oaste.cpp:26:12: error: 'j' was not declared in this scope for(j=1;j<=m;j++) ^ oaste.cpp:27:25: error: reference to 'max' is ambiguous if(a[i][j]!=0){ suma=max=0; ^ oaste.cpp:5:27: note: candidates are: int max int a[102][102],n,m,suma,max,lmax,cmax,S,MAX,LMAX,CMAX; ^ 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/istream:38, from /usr/include/c++/4.8/fstream:38, from oaste.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) ^ oaste.cpp:28:41: error: reference to 'max' is ambiguous fill(i,j,suma,max,lmax,cmax); ^ oaste.cpp:5:27: note: candidates are: int max int a[102][102],n,m,suma,max,lmax,cmax,S,MAX,LMAX,CMAX; ^ 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/istream:38, from /usr/include/c++/4.8/fstream:38, from oaste.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) ^ oaste.cpp:29:41: error: reference to 'max' is ambiguous if(suma>S){S=suma;MAX=max;LMAX=lmax;CMAX=cmax;} ^ oaste.cpp:5:27: note: candidates are: int max int a[102][102],n,m,suma,max,lmax,cmax,S,MAX,LMAX,CMAX; ^ 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/istream:38, from /usr/include/c++/4.8/fstream:38, from oaste.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) ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema oaste 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ă.