#1471
Scrieţi un program care afişează, pentru un şir dat format din n
numere naturale numărul de secvenţe maxdiv şi cea mai lungă secvenţă maxdiv.
Olimpiada Municipala Informatica Iasi 2016
Problema | maxdiv | Operații I/O |
![]() maxdiv.in /maxdiv.out
|
---|---|---|---|
Limita timp | 1 secunde | Limita memorie |
Total: 2 MB
/
Stivă 1 MB
|
Id soluție | #57080009 | Utilizator | |
Fișier | maxdiv.cpp | Dimensiune | 1.16 KB |
Data încărcării | 14 Martie 2025, 22:53 | Scor / rezultat | Eroare de compilare |
maxdiv.cpp:7:13: error: 'int fmax' redeclared as different kind of symbol int i,j,n,k,fmax=-1,nk,p = 0,cp,d,cntd,c,ok=1,l,p1,p2; ^ In file included from /usr/include/features.h:374:0, from /usr/include/i386-linux-gnu/c++/4.8/bits/os_defines.h:39, from /usr/include/i386-linux-gnu/c++/4.8/bits/c++config.h:426, from /usr/include/c++/4.8/iosfwd:38, from /usr/include/c++/4.8/ios:38, from /usr/include/c++/4.8/istream:38, from /usr/include/c++/4.8/fstream:38, from maxdiv.cpp:1: /usr/include/i386-linux-gnu/bits/mathcalls.h:340:1: error: previous declaration of 'double fmax(double, double)' __MATHCALLX (fmax,, (_Mdouble_ __x, _Mdouble_ __y), (__const__)); ^ maxdiv.cpp: In function 'int main()': maxdiv.cpp:32:9: error: overloaded function with no contextual type information fmax = f[n]; ^ maxdiv.cpp:34:17: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator==' if(f[i]==fmax){ ^ maxdiv.cpp:41:17: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator>' if(f[i]>fmax){ ^ maxdiv.cpp:42:18: error: overloaded function with no contextual type information fmax = f[i]; ^ maxdiv.cpp:47:22: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<=' if(f[i] <= fmax){ ^ maxdiv.cpp:55:20: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator==' if(f[i]==fmax){ ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema maxdiv 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ă.