#1446
Memory002
Fiind dat un şir format din n
numere naturale distincte să se calculeze suma elementelor din secvenţa ce uneşte cel mai mic şi cel mai mare element din şir, inclusiv acestea.
Problema | Memory002 | Operații I/O |
memory002.in /memory002.out
|
---|---|---|---|
Limita timp | 0.15 secunde | Limita memorie |
Total: 0.1 MB
/
Stivă 0 MB
|
Id soluție | #50070303 | Utilizator | |
Fișier | memory002.cpp | Dimensiune | 834 B |
Data încărcării | 26 Martie 2024, 09:31 | Scor / rezultat | Eroare de compilare |
memory002.cpp: In function 'int main()': memory002.cpp:28:5: error: 'longlong' was not declared in this scope longlong n, min = 2000000001, max = -2000000001, minPoz = 0, maxPoz = 0; ^ memory002.cpp:28:14: error: expected ';' before 'n' longlong n, min = 2000000001, max = -2000000001, minPoz = 0, maxPoz = 0; ^ memory002.cpp:29:11: error: 'n' was not declared in this scope cin>> n; ^ memory002.cpp:33:15: error: 'v' was not declared in this scope cin>> v[i]; ^ memory002.cpp:34:12: error: parse error in template argument list if(max < v[i]){ ^ memory002.cpp:34:22: error: cannot resolve overloaded function 'max' based on conversion to type 'bool' if(max < v[i]){ ^ memory002.cpp:36:13: error: 'maxPoz' was not declared in this scope maxPoz = i; ^ memory002.cpp:40:13: error: 'minPoz' was not declared in this scope minPoz = i; ^ memory002.cpp:45:22: error: 'maxPoz' was not declared in this scope for(int i = minA(maxPoz, minPoz); i <= maxA(maxPoz, minPoz); i++){ ^ memory002.cpp:45:30: error: 'minPoz' was not declared in this scope for(int i = minA(maxPoz, minPoz); i <= maxA(maxPoz, minPoz); i++){ ^ memory002.cpp:46:14: error: 'v' was not declared in this scope s += v[i]; ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Memory002 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ă.