Detalii evaluare #52876063

Rezumat problemă

Moș Crăciun pregătește cadourile pentru acest an. El trebuie să dea cadouri identice la n copii. Pentru aceasta, a vizitat m magazine (posibil online) și pentru fiecare magazin a aflat prețul cadoului în acel magazin și numărul de cadouri disponibile în acel magazin.

Determinati suma minimă necesară pentru a cumpăra cele n cadouri. Dacă nu se pot cumpăra cele n cadouri afișați mesajul imposibil.

Detalii

Problema MosCraciun2 Operații I/O tastatură/ecran
Limita timp 0.1 secunde Limita memorie Total: 64 MB / Stivă 8 MB
Id soluție #52876063 Utilizator Enculescu Ana (Ana_Enculescu)
Fișier moscraciun2.cpp Dimensiune 824 B
Data încărcării 11 Octombrie 2024, 13:28 Scor / rezultat Eroare de compilare

Evaluare


Mesaj compilare

moscraciun2.cpp:5:1: error: stray '\302' in program
  

 ^
moscraciun2.cpp:5:1: error: stray '\240' in program
moscraciun2.cpp:9:1: error: stray '\302' in program
  

 ^
moscraciun2.cpp:9:1: error: stray '\240' in program
moscraciun2.cpp:16:1: error: stray '\302' in program
  

 ^
moscraciun2.cpp:16:1: error: stray '\240' in program
moscraciun2.cpp:20:1: error: stray '\302' in program
     return 1;

 ^
moscraciun2.cpp:20:1: error: stray '\240' in program
moscraciun2.cpp:20:1: error: stray '\302' in program
moscraciun2.cpp:20:1: error: stray '\240' in program
moscraciun2.cpp:20:1: error: stray '\302' in program
moscraciun2.cpp:20:1: error: stray '\240' in program
moscraciun2.cpp:24:1: error: stray '\302' in program
    int n,i,s=0,m;

 ^
moscraciun2.cpp:24:1: error: stray '\240' in program
moscraciun2.cpp:24:1: error: stray '\302' in program
moscraciun2.cpp:24:1: error: stray '\240' in program
moscraciun2.cpp:25:1: error: stray '\302' in program
    cin >> n>>m;

 ^
moscraciun2.cpp:25:1: error: stray '\240' in program
moscraciun2.cpp:25:1: error: stray '\302' in program
moscraciun2.cpp:25:1: error: stray '\240' in program
moscraciun2.cpp:26:1: error: stray '\302' in program
    for(i = 1;i<= m;i++){

 ^
moscraciun2.cpp:26:1: error: stray '\240' in program
moscraciun2.cpp:26:1: error: stray '\302' in program
moscraciun2.cpp:26:1: error: stray '\240' in program
moscraciun2.cpp:27:1: error: stray '\302' in program
         cin>> spectacole[i].sfarsit>>spectacole[i].inceput;

 ^
moscraciun2.cpp:27:1: error: stray '\240' in program
moscraciun2.cpp:27:1: error: stray '\302' in program
moscraciun2.cpp:27:1: error: stray '\240' in program
moscraciun2.cpp:27:1: error: stray '\302' in program
moscraciun2.cpp:27:1: error: stray '\240' in program
moscraciun2.cpp:27:1: error: stray '\302' in program
moscraciun2.cpp:27:1: error: stray '\240' in program
moscraciun2.cpp:27:1: error: stray '\302' in program
moscraciun2.cpp:27:1: error: stray '\240' in program
moscraciun2.cpp:27:1: error: stray '\302' in program
moscraciun2.cpp:27:1: error: stray '\240' in program
moscraciun2.cpp:27:1: error: stray '\302' in program
moscraciun2.cpp:27:1: error: stray '\240' in program
moscraciun2.cpp:29:1: error: stray '\302' in program
  

 ^
moscraciun2.cpp:29:1: error: stray '\240' in program
moscraciun2.cpp:31:1: error: stray '\302' in program
     }

 ^
moscraciun2.cpp:31:1: error: stray '\240' in program
moscraciun2.cpp:31:1: error: stray '\302' in program
moscraciun2.cpp:31:1: error: stray '\240' in program
moscraciun2.cpp:31:1: error: stray '\302' in program
moscraciun2.cpp:31:1: error: stray '\240' in program
moscraciun2.cpp:32:1: error: stray '\302' in program
    sort(spectacole+1, spectacole+m+1, cmp);

 ^
moscraciun2.cpp:32:1: error: stray '\240' in program
moscraciun2.cpp:32:1: error: stray '\302' in program
moscraciun2.cpp:32:1: error: stray '\240' in program
moscraciun2.cpp:33:1: error: stray '\302' in program
    i=1;

 ^
moscraciun2.cpp:33:1: error: stray '\240' in program
moscraciun2.cpp:33:1: error: stray '\302' in program
moscraciun2.cpp:33:1: error: stray '\240' in program
moscraciun2.cpp:34:1: error: stray '\302' in program
    while(n>0){

 ^
moscraciun2.cpp:34:1: error: stray '\240' in program
moscraciun2.cpp:34:1: error: stray '\302' in program
moscraciun2.cpp:34:1: error: stray '\240' in program
moscraciun2.cpp:35:1: error: stray '\302' in program
         if(spectacole[i].inceput<=n) {s+=spectacole[i].sfarsit*spectacole[i].inceput; n-=spectacole[i].inceput;}

 ^
moscraciun2.cpp:35:1: error: stray '\240' in program
moscraciun2.cpp:35:1: error: stray '\302' in program
moscraciun2.cpp:35:1: error: stray '\240' in program
moscraciun2.cpp:35:1: error: stray '\302' in program
moscraciun2.cpp:35:1: error: stray '\240' in program
moscraciun2.cpp:35:1: error: stray '\302' in program
moscraciun2.cpp:35:1: error: stray '\240' in program
moscraciun2.cpp:35:1: error: stray '\302' in program
moscraciun2.cpp:35:1: error: stray '\240' in program
moscraciun2.cpp:35:1: error: stray '\302' in program
moscraciun2.cpp:35:1: error: stray '\240' in program
moscraciun2.cpp:35:1: error: stray '\302' in program
moscraciun2.cpp:35:1: error: stray '\240' in program
moscraciun2.cpp:36:1: error: stray '\302' in program
         else {s+=spectacole[i].sfarsit*n; n=0;}

 ^
moscraciun2.cpp:36:1: error: stray '\240' in program
moscraciun2.cpp:36:1: error: stray '\302' in program
moscraciun2.cpp:36:1: error: stray '\240' in program
moscraciun2.cpp:36:1: error: stray '\302' in program
moscraciun2.cpp:36:1: error: stray '\240' in program
moscraciun2.cpp:36:1: error: stray '\302' in program
moscraciun2.cpp:36:1: error: stray '\240' in program
moscraciun2.cpp:36:1: error: stray '\302' in program
moscraciun2.cpp:36:1: error: stray '\240' in program
moscraciun2.cpp:36:1: error: stray '\302' in program
moscraciun2.cpp:36:1: error: stray '\240' in program
moscraciun2.cpp:36:1: error: stray '\302' in program
moscraciun2.cpp:36:1: error: stray '\240' in program
moscraciun2.cpp:38:1: error: stray '\302' in program
         i++;

 ^
moscraciun2.cpp:38:1: error: stray '\240' in program
moscraciun2.cpp:40:1: error: stray '\302' in program
    }

 ^
moscraciun2.cpp:40:1: error: stray '\240' in program
moscraciun2.cpp:40:1: error: stray '\302' in program
moscraciun2.cpp:40:1: error: stray '\240' in program
moscraciun2.cpp:42:1: error: stray '\302' in program
  

 ^
moscraciun2.cpp:42:1: error: stray '\240' in program
moscraciun2.cpp:44:1: error: stray '\302' in program
    if(n==0) cout<<s;

 ^
moscraciun2.cpp:44:1: error: stray '\240' in program
moscraciun2.cpp:44:1: error: stray '\302' in program
moscraciun2.cpp:44:1: error: stray '\240' in program
moscraciun2.cpp:45:1: error: stray '\302' in program
    else cout<<"imposibil";

 ^
moscraciun2.cpp:45:1: error: stray '\240' in program
moscraciun2.cpp:45:1: error: stray '\302' in program
moscraciun2.cpp:45:1: error: stray '\240' in program
moscraciun2.cpp:47:1: error: stray '\302' in program
  

 ^
moscraciun2.cpp:47: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 MosCraciun2 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ă.