Detalii evaluare #60313364

Rezumat problemă

Se citesc două numere naturale nenule n și k. Să se afişeze, în ordine lexicografică, aranjamentele de câte k elemente ale mulţimii {1,2,..,n}.

Detalii

Problema Aranjamente Operații I/O aranjamente.in/aranjamente.out
Limita timp 0.5 secunde Limita memorie Total: 64 MB / Stivă 8 MB
Id soluție #60313364 Utilizator Toma Darius (deadmerc)
Fișier aranjamente.cpp Dimensiune 1.22 KB
Data încărcării 25 Octombrie 2025, 10:57 Scor/rezultat Eroare de compilare

Evaluare

Mesaj compilare

aranjamente.cpp: In function 'void back(int)':
aranjamente.cpp:23:12: warning: suggest explicit braces to avoid ambiguous 'else' [-Wparentheses]
         if (valid(k))

            ^
aranjamente.cpp: At global scope:
aranjamente.cpp:43:5: error: redefinition of 'int n'
 int n,k,sol[10];

     ^
aranjamente.cpp:4:5: error: 'int n' previously declared here
 int n,k,sol[10];

     ^
aranjamente.cpp:43:7: error: redefinition of 'int k'
 int n,k,sol[10];

       ^
aranjamente.cpp:4:7: error: 'int k' previously declared here
 int n,k,sol[10];

       ^
aranjamente.cpp:43:15: error: redefinition of 'int sol [10]'
 int n,k,sol[10];

               ^
aranjamente.cpp:4:9: error: 'int sol [10]' previously declared here
 int n,k,sol[10];

         ^
aranjamente.cpp:44:14: error: redefinition of 'std::ifstream fin'
 ifstream fin ("aranjamente.in");

              ^
aranjamente.cpp:5:10: error: 'std::ifstream fin' previously declared here
 ifstream fin ("aranjamente.in");

          ^
aranjamente.cpp:45:16: error: redefinition of 'std::ofstream fout'
  ofstream fout ("aranjamente.out");

                ^
aranjamente.cpp:6:11: error: 'std::ofstream fout' previously declared here
  ofstream fout ("aranjamente.out");

           ^
aranjamente.cpp: In function 'bool solutie(int)':
aranjamente.cpp:46:6: error: redefinition of 'bool solutie(int)'
 bool solutie(int j)

      ^
aranjamente.cpp:7:6: error: 'bool solutie(int)' previously defined here
 bool solutie(int j)

      ^
aranjamente.cpp: In function 'bool valid(int)':
aranjamente.cpp:50:6: error: redefinition of 'bool valid(int)'
 bool valid(int k)

      ^
aranjamente.cpp:11:6: error: 'bool valid(int)' previously defined here
 bool valid(int k)

      ^
aranjamente.cpp: In function 'void back(int)':
aranjamente.cpp:57:6: error: redefinition of 'void back(int)'
 void back(int k)

      ^
aranjamente.cpp:18:6: error: 'void back(int)' previously defined here
 void back(int k)

      ^
aranjamente.cpp:62:12: warning: suggest explicit braces to avoid ambiguous 'else' [-Wparentheses]
         if (valid(k))

            ^
aranjamente.cpp: In function 'int main()':
aranjamente.cpp:70:5: error: redefinition of 'int main()'
 int main ()

     ^
aranjamente.cpp:31:5: error: 'int main()' previously defined here
 int main ()

     ^

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 Aranjamente 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!