#165
maxsim
Să se determine perechea de elemente dintr-un vector egal depărtate de centru cu suma elementelor maximă.
Problema | maxsim | Operații I/O |
maxsim.in /maxsim.out
|
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #54207357 | Utilizator | |
Fișier | maxsim.cpp | Dimensiune | 465 B |
Data încărcării | 22 Noiembrie 2024, 09:37 | Scor / rezultat | Eroare de compilare |
maxsim.cpp:6:1: error: expected ',' or ';' before 'int' int n,x[1001],i,s,ma,st,fn; ^ maxsim.cpp: In function 'int main()': maxsim.cpp:9:10: error: 'n' was not declared in this scope cad>>n; ^ maxsim.cpp:10:9: error: 'i' was not declared in this scope for(i=1;i<=n;++i) ^ maxsim.cpp:11:14: error: 'x' was not declared in this scope cad>>x[i]; ^ maxsim.cpp:12:9: error: 'i' was not declared in this scope for(i=1;i<=n/2;++i) ^ maxsim.cpp:14:9: error: 's' was not declared in this scope s=x[i]+x[n-i+1]; ^ maxsim.cpp:14:11: error: 'x' was not declared in this scope s=x[i]+x[n-i+1]; ^ maxsim.cpp:15:18: error: 'ma' was not declared in this scope if(i==1) ma=s; ^ maxsim.cpp:16:12: error: 'ma' was not declared in this scope if(ma<s) ^ maxsim.cpp:19:13: error: 'st' was not declared in this scope st=i; ^ maxsim.cpp:20:13: error: 'fn' was not declared in this scope fn=n-i+1; ^ maxsim.cpp:23:13: error: 'ma' was not declared in this scope treide<<ma<<" "<<st<<" "<<fn; ^ maxsim.cpp:23:22: error: 'st' was not declared in this scope treide<<ma<<" "<<st<<" "<<fn; ^ maxsim.cpp:23:31: error: 'fn' was not declared in this scope treide<<ma<<" "<<st<<" "<<fn; ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema maxsim 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ă.