Detalii evaluare #57603180

Rezumat problemă

Se citește un număr natural n (n<31). Determinați în câte moduri se poate partiționa mulțimea {1,2,…,n} în două submulțimi disjuncte A și B astfel încât suma elementelor din submulțimea A să fie egală cu suma elementelor din submulțimea B.

Detalii

Problema sume_egale Operații I/O tastatură/ecran
Limita timp 2.5 secunde Limita memorie Total: 64 MB / Stivă 8 MB
Id soluție #57603180 Utilizator Manciu Cristina (Manciu_Cristina)
Fișier sume_egale.cpp Dimensiune 944 B
Data încărcării 07 Aprilie 2025, 11:59 Scor / rezultat Eroare de compilare

Evaluare

Mesaj compilare

sume_egale.cpp:8:1: error: stray '\302' in program
     int s=0;

 ^
sume_egale.cpp:8:1: error: stray '\240' in program
sume_egale.cpp:8:1: error: stray '\302' in program
sume_egale.cpp:8:1: error: stray '\240' in program
sume_egale.cpp:9:1: error: stray '\302' in program
     for(int i=1;i<=pas;i++)

 ^
sume_egale.cpp:9:1: error: stray '\240' in program
sume_egale.cpp:9:1: error: stray '\302' in program
sume_egale.cpp:9:1: error: stray '\240' in program
sume_egale.cpp:10:1: error: stray '\302' in program
         if(x[i]==v) s=s+i;

 ^
sume_egale.cpp:10:1: error: stray '\240' in program
sume_egale.cpp:10:1: error: stray '\302' in program
sume_egale.cpp:10:1: error: stray '\240' in program
sume_egale.cpp:10:1: error: stray '\302' in program
sume_egale.cpp:10:1: error: stray '\240' in program
sume_egale.cpp:10:1: error: stray '\302' in program
sume_egale.cpp:10:1: error: stray '\240' in program
sume_egale.cpp:11:1: error: stray '\302' in program
     return s;

 ^
sume_egale.cpp:11:1: error: stray '\240' in program
sume_egale.cpp:11:1: error: stray '\302' in program
sume_egale.cpp:11:1: error: stray '\240' in program
sume_egale.cpp:16:1: error: stray '\302' in program
     int sum=suma(pas,x[pas]);

 ^
sume_egale.cpp:16:1: error: stray '\240' in program
sume_egale.cpp:16:1: error: stray '\302' in program
sume_egale.cpp:16:1: error: stray '\240' in program
sume_egale.cpp:17:1: error: stray '\302' in program
     if(sum>S/2) return 0;

 ^
sume_egale.cpp:17:1: error: stray '\240' in program
sume_egale.cpp:17:1: error: stray '\302' in program
sume_egale.cpp:17:1: error: stray '\240' in program
sume_egale.cpp:18:1: error: stray '\302' in program
     if(pas==1 && x[pas]==2) return 0;

 ^
sume_egale.cpp:18:1: error: stray '\240' in program
sume_egale.cpp:18:1: error: stray '\302' in program
sume_egale.cpp:18:1: error: stray '\240' in program
sume_egale.cpp:19:1: error: stray '\302' in program
     return 1;

 ^
sume_egale.cpp:19:1: error: stray '\240' in program
sume_egale.cpp:19:1: error: stray '\302' in program
sume_egale.cpp:19:1: error: stray '\240' in program
sume_egale.cpp:24:1: error: stray '\302' in program
     for(int i=1;i<=n;i++)

 ^
sume_egale.cpp:24:1: error: stray '\240' in program
sume_egale.cpp:24:1: error: stray '\302' in program
sume_egale.cpp:24:1: error: stray '\240' in program
sume_egale.cpp:25:1: error: stray '\302' in program
         cout<<x[i]<<" ";

 ^
sume_egale.cpp:25:1: error: stray '\240' in program
sume_egale.cpp:25:1: error: stray '\302' in program
sume_egale.cpp:25:1: error: stray '\240' in program
sume_egale.cpp:25:1: error: stray '\302' in program
sume_egale.cpp:25:1: error: stray '\240' in program
sume_egale.cpp:25:1: error: stray '\302' in program
sume_egale.cpp:25:1: error: stray '\240' in program
sume_egale.cpp:26:1: error: stray '\302' in program
     cout<<endl;

 ^
sume_egale.cpp:26:1: error: stray '\240' in program
sume_egale.cpp:26:1: error: stray '\302' in program
sume_egale.cpp:26:1: error: stray '\240' in program
sume_egale.cpp:31:1: error: stray '\302' in program
     for(int i=1;i<=2;i++)

 ^
sume_egale.cpp:31:1: error: stray '\240' in program
sume_egale.cpp:31:1: error: stray '\302' in program
sume_egale.cpp:31:1: error: stray '\240' in program
sume_egale.cpp:32:1: error: stray '\302' in program
     {

 ^
sume_egale.cpp:32:1: error: stray '\240' in program
sume_egale.cpp:32:1: error: stray '\302' in program
sume_egale.cpp:32:1: error: stray '\240' in program
sume_egale.cpp:33:1: error: stray '\302' in program
         x[pas]=i;

 ^
sume_egale.cpp:33:1: error: stray '\240' in program
sume_egale.cpp:33:1: error: stray '\302' in program
sume_egale.cpp:33:1: error: stray '\240' in program
sume_egale.cpp:33:1: error: stray '\302' in program
sume_egale.cpp:33:1: error: stray '\240' in program
sume_egale.cpp:33:1: error: stray '\302' in program
sume_egale.cpp:33:1: error: stray '\240' in program
sume_egale.cpp:34:1: error: stray '\302' in program
         if(valid(pas))

 ^
sume_egale.cpp:34:1: error: stray '\240' in program
sume_egale.cpp:34:1: error: stray '\302' in program
sume_egale.cpp:34:1: error: stray '\240' in program
sume_egale.cpp:34:1: error: stray '\302' in program
sume_egale.cpp:34:1: error: stray '\240' in program
sume_egale.cpp:34:1: error: stray '\302' in program
sume_egale.cpp:34:1: error: stray '\240' in program
sume_egale.cpp:35:1: error: stray '\302' in program
         {

 ^
sume_egale.cpp:35:1: error: stray '\240' in program
sume_egale.cpp:35:1: error: stray '\302' in program
sume_egale.cpp:35:1: error: stray '\240' in program
sume_egale.cpp:35:1: error: stray '\302' in program
sume_egale.cpp:35:1: error: stray '\240' in program
sume_egale.cpp:35:1: error: stray '\302' in program
sume_egale.cpp:35:1: error: stray '\240' in program
sume_egale.cpp:36:1: error: stray '\302' in program
             if(pas==n)

 ^
sume_egale.cpp:36:1: error: stray '\240' in program
sume_egale.cpp:36:1: error: stray '\302' in program
sume_egale.cpp:36:1: error: stray '\240' in program
sume_egale.cpp:36:1: error: stray '\302' in program
sume_egale.cpp:36:1: error: stray '\240' in program
sume_egale.cpp:36:1: error: stray '\302' in program
sume_egale.cpp:36:1: error: stray '\240' in program
sume_egale.cpp:36:1: error: stray '\302' in program
sume_egale.cpp:36:1: error: stray '\240' in program
sume_egale.cpp:36:1: error: stray '\302' in program
sume_egale.cpp:36:1: error: stray '\240' in program
sume_egale.cpp:37:1: error: stray '\302' in program
             {

 ^
sume_egale.cpp:37:1: error: stray '\240' in program
sume_egale.cpp:37:1: error: stray '\302' in program
sume_egale.cpp:37:1: error: stray '\240' in program
sume_egale.cpp:37:1: error: stray '\302' in program
sume_egale.cpp:37:1: error: stray '\240' in program
sume_egale.cpp:37:1: error: stray '\302' in program
sume_egale.cpp:37:1: error: stray '\240' in program
sume_egale.cpp:37:1: error: stray '\302' in program
sume_egale.cpp:37:1: error: stray '\240' in program
sume_egale.cpp:37:1: error: stray '\302' in program
sume_egale.cpp:37:1: error: stray '\240' in program
sume_egale.cpp:38:1: error: stray '\302' in program
                 nr++;

 ^
sume_egale.cpp:38:1: error: stray '\240' in program
sume_egale.cpp:38:1: error: stray '\302' in program
sume_egale.cpp:38:1: error: stray '\240' in program
sume_egale.cpp:38:1: error: stray '\302' in program
sume_egale.cpp:38:1: error: stray '\240' in program
sume_egale.cpp:38:1: error: stray '\302' in program
sume_egale.cpp:38:1: error: stray '\240' in program
sume_egale.cpp:38:1: error: stray '\302' in program
sume_egale.cpp:38:1: error: stray '\240' in program
sume_egale.cpp:38:1: error: stray '\302' in program
sume_egale.cpp:38:1: error: stray '\240' in program
sume_egale.cpp:38:1: error: stray '\302' in program
sume_egale.cpp:38:1: error: stray '\240' in program
sume_egale.cpp:38:1: error: stray '\302' in program
sume_egale.cpp:38:1: error: stray '\240' in program
sume_egale.cpp:39:1: error: stray '\302' in program
                 ///afis();

 ^
sume_egale.cpp:39:1: error: stray '\240' in program
sume_egale.cpp:39:1: error: stray '\302' in program
sume_egale.cpp:39:1: error: stray '\240' in program
sume_egale.cpp:39:1: error: stray '\302' in program
sume_egale.cpp:39:1: error: stray '\240' in program
sume_egale.cpp:39:1: error: stray '\302' in program
sume_egale.cpp:39:1: error: stray '\240' in program
sume_egale.cpp:39:1: error: stray '\302' in program
sume_egale.cpp:39:1: error: stray '\240' in program
sume_egale.cpp:39:1: error: stray '\302' in program
sume_egale.cpp:39:1: error: stray '\240' in program
sume_egale.cpp:39:1: error: stray '\302' in program
sume_egale.cpp:39:1: error: stray '\240' in program
sume_egale.cpp:39:1: error: stray '\302' in program
sume_egale.cpp:39:1: error: stray '\240' in program
sume_egale.cpp:40:1: error: stray '\302' in program
             }

 ^
sume_egale.cpp:40:1: error: stray '\240' in program
sume_egale.cpp:40:1: error: stray '\302' in program
sume_egale.cpp:40:1: error: stray '\240' in program
sume_egale.cpp:40:1: error: stray '\302' in program
sume_egale.cpp:40:1: error: stray '\240' in program
sume_egale.cpp:40:1: error: stray '\302' in program
sume_egale.cpp:40:1: error: stray '\240' in program
sume_egale.cpp:40:1: error: stray '\302' in program
sume_egale.cpp:40:1: error: stray '\240' in program
sume_egale.cpp:40:1: error: stray '\302' in program
sume_egale.cpp:40:1: error: stray '\240' in program
sume_egale.cpp:41:1: error: stray '\302' in program
             else bck(pas+1);

 ^
sume_egale.cpp:41:1: error: stray '\240' in program
sume_egale.cpp:41:1: error: stray '\302' in program
sume_egale.cpp:41:1: error: stray '\240' in program
sume_egale.cpp:41:1: error: stray '\302' in program
sume_egale.cpp:41:1: error: stray '\240' in program
sume_egale.cpp:41:1: error: stray '\302' in program
sume_egale.cpp:41:1: error: stray '\240' in program
sume_egale.cpp:41:1: error: stray '\302' in program
sume_egale.cpp:41:1: error: stray '\240' in program
sume_egale.cpp:41:1: error: stray '\302' in program
sume_egale.cpp:41:1: error: stray '\240' in program
sume_egale.cpp:42:1: error: stray '\302' in program
         }

 ^
sume_egale.cpp:42:1: error: stray '\240' in program
sume_egale.cpp:42:1: error: stray '\302' in program
sume_egale.cpp:42:1: error: stray '\240' in program
sume_egale.cpp:42:1: error: stray '\302' in program
sume_egale.cpp:42:1: error: stray '\240' in program
sume_egale.cpp:42:1: error: stray '\302' in program
sume_egale.cpp:42:1: error: stray '\240' in program
sume_egale.cpp:43:1: error: stray '\302' in program
     }

 ^
sume_egale.cpp:43:1: error: stray '\240' in program
sume_egale.cpp:43:1: error: stray '\302' in program
sume_egale.cpp:43:1: error: stray '\240' in program
sume_egale.cpp:48:1: error: stray '\302' in program
     cin>>n;

 ^
sume_egale.cpp:48:1: error: stray '\240' in program
sume_egale.cpp:48:1: error: stray '\302' in program
sume_egale.cpp:48:1: error: stray '\240' in program
sume_egale.cpp:49:1: error: stray '\302' in program
     S=(n*(n+1))/2;

 ^
sume_egale.cpp:49:1: error: stray '\240' in program
sume_egale.cpp:49:1: error: stray '\302' in program
sume_egale.cpp:49:1: error: stray '\240' in program
sume_egale.cpp:50:1: error: stray '\302' in program
     if(S%2==1) cout<<0;

 ^
sume_egale.cpp:50:1: error: stray '\240' in program
sume_egale.cpp:50:1: error: stray '\302' in program
sume_egale.cpp:50:1: error: stray '\240' in program
sume_egale.cpp:51:1: error: stray '\302' in program
     else

 ^
sume_egale.cpp:51:1: error: stray '\240' in program
sume_egale.cpp:51:1: error: stray '\302' in program
sume_egale.cpp:51:1: error: stray '\240' in program
sume_egale.cpp:52:1: error: stray '\302' in program
     {

 ^
sume_egale.cpp:52:1: error: stray '\240' in program
sume_egale.cpp:52:1: error: stray '\302' in program
sume_egale.cpp:52:1: error: stray '\240' in program
sume_egale.cpp:53:1: error: stray '\302' in program
         bck(1);

 ^
sume_egale.cpp:53:1: error: stray '\240' in program
sume_egale.cpp:53:1: error: stray '\302' in program
sume_egale.cpp:53:1: error: stray '\240' in program
sume_egale.cpp:53:1: error: stray '\302' in program
sume_egale.cpp:53:1: error: stray '\240' in program
sume_egale.cpp:53:1: error: stray '\302' in program
sume_egale.cpp:53:1: error: stray '\240' in program
sume_egale.cpp:54:1: error: stray '\302' in program
         cout<<nr;

 ^
sume_egale.cpp:54:1: error: stray '\240' in program
sume_egale.cpp:54:1: error: stray '\302' in program
sume_egale.cpp:54:1: error: stray '\240' in program
sume_egale.cpp:54:1: error: stray '\302' in program
sume_egale.cpp:54:1: error: stray '\240' in program
sume_egale.cpp:54:1: error: stray '\302' in program
sume_egale.cpp:54:1: error: stray '\240' in program
sume_egale.cpp:55:1: error: stray '\302' in program
     }

 ^
sume_egale.cpp:55:1: error: stray '\240' in program
sume_egale.cpp:55:1: error: stray '\302' in program
sume_egale.cpp:55:1: error: stray '\240' in program
sume_egale.cpp:56:1: error: stray '\302' in program
     return 0;

 ^
sume_egale.cpp:56:1: error: stray '\240' in program
sume_egale.cpp:56:1: error: stray '\302' in program
sume_egale.cpp:56:1: error: stray '\240' in program

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

Du-te sus!