#1015
SumVec
Se consideră un șir cu n
elemente, numere naturale. Folosind metoda Divide et Impera, determinați suma elementelor acestui șir.
Problema | SumVec | Operații I/O | tastatură/ecran |
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #22731740 | Utilizator | |
Fișier | sumvec.cpp | Dimensiune | 428 B |
Data încărcării | 03 Mai 2020, 12:10 | Scor / rezultat | Eroare de compilare |
sumvec.cpp:6:1: error: stray '\302' in program if ( e - b == 0 ) ^ sumvec.cpp:6:1: error: stray '\240' in program sumvec.cpp:6:1: error: stray '\302' in program sumvec.cpp:6:1: error: stray '\240' in program sumvec.cpp:7:1: error: stray '\302' in program return v[b]; ^ sumvec.cpp:7:1: error: stray '\240' in program sumvec.cpp:7:1: error: stray '\302' in program sumvec.cpp:7:1: error: stray '\240' in program sumvec.cpp:7:1: error: stray '\302' in program sumvec.cpp:7:1: error: stray '\240' in program sumvec.cpp:7:1: error: stray '\302' in program sumvec.cpp:7:1: error: stray '\240' in program sumvec.cpp:8:1: error: stray '\302' in program else ^ sumvec.cpp:8:1: error: stray '\240' in program sumvec.cpp:8:1: error: stray '\302' in program sumvec.cpp:8:1: error: stray '\240' in program sumvec.cpp:9:1: error: stray '\302' in program return suma( v, b, ( b + e ) / 2 ) + suma( v, ( b + e ) / 2 + 1, e ); ^ sumvec.cpp:9:1: error: stray '\240' in program sumvec.cpp:9:1: error: stray '\302' in program sumvec.cpp:9:1: error: stray '\240' in program sumvec.cpp:9:1: error: stray '\302' in program sumvec.cpp:9:1: error: stray '\240' in program sumvec.cpp:9:1: error: stray '\302' in program sumvec.cpp:9:1: error: stray '\240' in program sumvec.cpp:13:1: error: stray '\302' in program int n, i; ^ sumvec.cpp:13:1: error: stray '\240' in program sumvec.cpp:13:1: error: stray '\302' in program sumvec.cpp:13:1: error: stray '\240' in program sumvec.cpp:13:1: error: stray '\302' in program sumvec.cpp:13:1: error: stray '\240' in program sumvec.cpp:15:1: error: stray '\302' in program cin >> n; ^ sumvec.cpp:15:1: error: stray '\240' in program sumvec.cpp:15:1: error: stray '\302' in program sumvec.cpp:15:1: error: stray '\240' in program sumvec.cpp:16:1: error: stray '\302' in program int v[n]; ^ sumvec.cpp:16:1: error: stray '\240' in program sumvec.cpp:16:1: error: stray '\302' in program sumvec.cpp:16:1: error: stray '\240' in program sumvec.cpp:18:1: error: stray '\302' in program for ( i = 0; i < n; i ++ ) ^ sumvec.cpp:18:1: error: stray '\240' in program sumvec.cpp:18:1: error: stray '\302' in program sumvec.cpp:18:1: error: stray '\240' in program sumvec.cpp:19:1: error: stray '\302' in program cin >> v[i]; ^ sumvec.cpp:19:1: error: stray '\240' in program sumvec.cpp:19:1: error: stray '\302' in program sumvec.cpp:19:1: error: stray '\240' in program sumvec.cpp:19:1: error: stray '\302' in program sumvec.cpp:19:1: error: stray '\240' in program sumvec.cpp:19:1: error: stray '\302' in program sumvec.cpp:19:1: error: stray '\240' in program sumvec.cpp:21:1: error: stray '\302' in program cout << suma( v, 0, n - 1 ); ^ sumvec.cpp:21:1: error: stray '\240' in program sumvec.cpp:21:1: error: stray '\302' in program sumvec.cpp:21:1: error: stray '\240' in program sumvec.cpp:23:1: error: stray '\302' in program return 0; ^ sumvec.cpp:23:1: error: stray '\240' in program sumvec.cpp:23:1: error: stray '\302' in program sumvec.cpp:23:1: error: stray '\240' in program
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema SumVec 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ă.