Detalii evaluare #22943513

Rezumat problemă

#1015 SumVec

Se consideră un șir cu n elemente, numere naturale. Folosind metoda Divide et Impera, determinați suma elementelor acestui șir.

Detalii

Problema SumVec Operații I/O tastatură/ecran
Limita timp 0.1 secunde Limita memorie Total: 64 MB / Stivă 8 MB
Id soluție #22943513 Utilizator Gavra Luca (gavra_luca)
Fișier sumvec.cpp Dimensiune 529 B
Data încărcării 13 Mai 2020, 22:36 Scor / rezultat Eroare de compilare

Evaluare


Mesaj compilare

sumvec.cpp:3:1: error: stray '\302' in program
   int suma( int x[], int i, int j)

 ^
sumvec.cpp:3:1: error: stray '\240' in program
sumvec.cpp:4:1: error: stray '\302' in program
  {

 ^
sumvec.cpp:4:1: error: stray '\240' in program
sumvec.cpp:5:1: error: stray '\302' in program
     int v1, v2, s=0;

 ^
sumvec.cpp:5:1: error: stray '\240' in program
sumvec.cpp:5:1: error: stray '\302' in program
sumvec.cpp:5:1: error: stray '\240' in program
sumvec.cpp:6:1: error: stray '\302' in program
      if(i==j) return x[i];

 ^
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: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
     else

 ^
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
     {

 ^
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
         v1=suma(x, i, (i+j)/2);

 ^
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:10:1: error: stray '\302' in program
          v2=suma(x, (i+j)/2+1,j);

 ^
sumvec.cpp:10:1: error: stray '\240' in program
sumvec.cpp:10:1: error: stray '\302' in program
sumvec.cpp:10:1: error: stray '\240' in program
sumvec.cpp:10:1: error: stray '\302' in program
sumvec.cpp:10:1: error: stray '\240' in program
sumvec.cpp:10:1: error: stray '\302' in program
sumvec.cpp:10:1: error: stray '\240' in program
sumvec.cpp:10:1: error: stray '\302' in program
sumvec.cpp:10:1: error: stray '\240' in program
sumvec.cpp:11:1: error: stray '\302' in program
          if(v1%2==0 && v2%2==0) return s=v1+v2;

 ^
sumvec.cpp:11:1: error: stray '\240' in program
sumvec.cpp:11:1: error: stray '\302' in program
sumvec.cpp:11:1: error: stray '\240' in program
sumvec.cpp:11:1: error: stray '\302' in program
sumvec.cpp:11:1: error: stray '\240' in program
sumvec.cpp:11:1: error: stray '\302' in program
sumvec.cpp:11:1: error: stray '\240' in program
sumvec.cpp:11:1: error: stray '\302' in program
sumvec.cpp:11:1: error: stray '\240' in program
sumvec.cpp:12:1: error: stray '\302' in program
         if(v2%2==0) return s=s+v2;

 ^
sumvec.cpp:12:1: error: stray '\240' in program
sumvec.cpp:12:1: error: stray '\302' in program
sumvec.cpp:12:1: error: stray '\240' in program
sumvec.cpp:12:1: error: stray '\302' in program
sumvec.cpp:12:1: error: stray '\240' in program
sumvec.cpp:12:1: error: stray '\302' in program
sumvec.cpp:12:1: error: stray '\240' in program
sumvec.cpp:13:1: error: stray '\302' in program
          if(v1%2==0) return s=s+v1;

 ^
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: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:14:1: error: stray '\302' in program
     }

 ^
sumvec.cpp:14:1: error: stray '\240' in program
sumvec.cpp:14:1: error: stray '\302' in program
sumvec.cpp:14:1: error: stray '\240' in program
sumvec.cpp:19:1: error: stray '\302' in program
     int a[1002], i, n;

 ^
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:20:1: error: stray '\302' in program
     cin>>n;

 ^
sumvec.cpp:20:1: error: stray '\240' in program
sumvec.cpp:20:1: error: stray '\302' in program
sumvec.cpp:20:1: error: stray '\240' in program
sumvec.cpp:21:1: error: stray '\302' in program
      for(i=1;i<=n;i++) cin>>a[i];

 ^
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:21:1: error: stray '\302' in program
sumvec.cpp:21:1: error: stray '\240' in program
sumvec.cpp:22:1: error: stray '\302' in program
     cout<<suma(a,1,n);

 ^
sumvec.cpp:22:1: error: stray '\240' in program
sumvec.cpp:22:1: error: stray '\302' in program
sumvec.cpp:22: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
sumvec.cpp: In function 'int suma(int*, int, int)':
sumvec.cpp:15:1: warning: control reaches end of non-void function [-Wreturn-type]
 }

 ^

Cum funcționează evaluarea?

www.pbinfo.ro permite evaluarea a două tipuri de probleme:

  • probleme la care rezolvarea presupune scrierea unui program complet
  • probleme la care rezolvarea presupune scrierea unei secvențe de program - câteva instrucțiuni, o listă de declarații, una sau mai multe funcții, etc.

Problema SumVec face parte din prima categorie. Soluția propusă de tine va fi evaluată astfel:

  • Programul sursă este compilat folosind compilatorul corespunzător. Dacă în urma compilării se obțin erori sau avertismente, acestea sunt afișate în această pagină.
  • Dacă programul a fost compilat, executabilul obținut va fi rulat, furnizându-i-se unul sau mai multe seturi de date de intrare, în concordanță cu restricțiile specifice problemei. Pentru fiecare set de date se obține un anumit punctaj, în raport cu corectitudinea soluției tale.

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ă.