Detalii evaluare #11395840

Rezumat problemă

#2560 bits

Se dă un număr natural N. Determinați valoarea unor anumiți biți din reprezentarea sa în baza 2.

Balcaniada de Informatică 2018, ziua de antrenament

Detalii

Problema bits Operații I/O bits.in/bits.out
Limita timp 0.1 secunde Limita memorie Total: 128 MB / Stivă 32 MB
Id soluție #11395840 Utilizator Stefan Serafim (serdafim24)
Fișier bits.cpp Dimensiune 480 B
Data încărcării 27 Octombrie 2018, 14:46 Scor / rezultat Eroare de compilare

Evaluare


Mesaj compilare

bits.cpp:6:1: error: stray '\302' in program
     int i,n,b,length,res=0;

 ^
bits.cpp:6:1: error: stray '\240' in program
bits.cpp:6:1: error: stray '\302' in program
bits.cpp:6:1: error: stray '\240' in program
bits.cpp:6:1: error: stray '\302' in program
bits.cpp:6:1: error: stray '\240' in program
bits.cpp:7:1: error: stray '\302' in program
     double a=3,c=4;

 ^
bits.cpp:7:1: error: stray '\240' in program
bits.cpp:7:1: error: stray '\302' in program
bits.cpp:7:1: error: stray '\240' in program
bits.cpp:7:1: error: stray '\302' in program
bits.cpp:7:1: error: stray '\240' in program
bits.cpp:8:1: error: stray '\302' in program
     cin>>n>>b;

 ^
bits.cpp:8:1: error: stray '\240' in program
bits.cpp:8:1: error: stray '\302' in program
bits.cpp:8:1: error: stray '\240' in program
bits.cpp:8:1: error: stray '\302' in program
bits.cpp:8:1: error: stray '\240' in program
bits.cpp:9:1: error: stray '\302' in program
     int temp=n;

 ^
bits.cpp:9:1: error: stray '\240' in program
bits.cpp:9:1: error: stray '\302' in program
bits.cpp:9:1: error: stray '\240' in program
bits.cpp:9:1: error: stray '\302' in program
bits.cpp:9:1: error: stray '\240' in program
bits.cpp:10:1: error: stray '\302' in program
     length=0;

 ^
bits.cpp:10:1: error: stray '\240' in program
bits.cpp:10:1: error: stray '\302' in program
bits.cpp:10:1: error: stray '\240' in program
bits.cpp:10:1: error: stray '\302' in program
bits.cpp:10:1: error: stray '\240' in program
bits.cpp:12:1: error: stray '\302' in program
     while(temp>0){

 ^
bits.cpp:12:1: error: stray '\240' in program
bits.cpp:12:1: error: stray '\302' in program
bits.cpp:12:1: error: stray '\240' in program
bits.cpp:12:1: error: stray '\302' in program
bits.cpp:12:1: error: stray '\240' in program
bits.cpp:13:1: error: stray '\302' in program
         temp=temp/b;

 ^
bits.cpp:13:1: error: stray '\240' in program
bits.cpp:13:1: error: stray '\302' in program
bits.cpp:13:1: error: stray '\240' in program
bits.cpp:13:1: error: stray '\302' in program
bits.cpp:13:1: error: stray '\240' in program
bits.cpp:13:1: error: stray '\302' in program
bits.cpp:13:1: error: stray '\240' in program
bits.cpp:13:1: error: stray '\302' in program
bits.cpp:13:1: error: stray '\240' in program
bits.cpp:13:1: error: stray '\302' in program
bits.cpp:13:1: error: stray '\240' in program
bits.cpp:14:1: error: stray '\302' in program
         length++;    

 ^
bits.cpp:14:1: error: stray '\240' in program
bits.cpp:14:1: error: stray '\302' in program
bits.cpp:14:1: error: stray '\240' in program
bits.cpp:14:1: error: stray '\302' in program
bits.cpp:14:1: error: stray '\240' in program
bits.cpp:14:1: error: stray '\302' in program
bits.cpp:14:1: error: stray '\240' in program
bits.cpp:14:1: error: stray '\302' in program
bits.cpp:14:1: error: stray '\240' in program
bits.cpp:14:1: error: stray '\302' in program
bits.cpp:14:1: error: stray '\240' in program
bits.cpp:14:1: error: stray '\302' in program
bits.cpp:14:1: error: stray '\240' in program
bits.cpp:14:1: error: stray '\302' in program
bits.cpp:14:1: error: stray '\240' in program
bits.cpp:14:1: error: stray '\302' in program
bits.cpp:14:1: error: stray '\240' in program
bits.cpp:15:1: error: stray '\302' in program
     }

 ^
bits.cpp:15:1: error: stray '\240' in program
bits.cpp:15:1: error: stray '\302' in program
bits.cpp:15:1: error: stray '\240' in program
bits.cpp:15:1: error: stray '\302' in program
bits.cpp:15:1: error: stray '\240' in program
bits.cpp:16:1: error: stray '\302' in program
     

 ^
bits.cpp:16:1: error: stray '\240' in program
bits.cpp:16:1: error: stray '\302' in program
bits.cpp:16:1: error: stray '\240' in program
bits.cpp:16:1: error: stray '\302' in program
bits.cpp:16:1: error: stray '\240' in program
bits.cpp:17:1: error: stray '\302' in program
     for(i=0;i<length;i++){

 ^
bits.cpp:17:1: error: stray '\240' in program
bits.cpp:17:1: error: stray '\302' in program
bits.cpp:17:1: error: stray '\240' in program
bits.cpp:17:1: error: stray '\302' in program
bits.cpp:17:1: error: stray '\240' in program
bits.cpp:18:1: error: stray '\302' in program
         

 ^
bits.cpp:18:1: error: stray '\240' in program
bits.cpp:18:1: error: stray '\302' in program
bits.cpp:18:1: error: stray '\240' in program
bits.cpp:18:1: error: stray '\302' in program
bits.cpp:18:1: error: stray '\240' in program
bits.cpp:18:1: error: stray '\302' in program
bits.cpp:18:1: error: stray '\240' in program
bits.cpp:18:1: error: stray '\302' in program
bits.cpp:18:1: error: stray '\240' in program
bits.cpp:18:1: error: stray '\302' in program
bits.cpp:18:1: error: stray '\240' in program
bits.cpp:19:1: error: stray '\302' in program
         res=res*10+(n/pow(b,length-1-i));

 ^
bits.cpp:19:1: error: stray '\240' in program
bits.cpp:19:1: error: stray '\302' in program
bits.cpp:19:1: error: stray '\240' in program
bits.cpp:19:1: error: stray '\302' in program
bits.cpp:19:1: error: stray '\240' in program
bits.cpp:19:1: error: stray '\302' in program
bits.cpp:19:1: error: stray '\240' in program
bits.cpp:19:1: error: stray '\302' in program
bits.cpp:19:1: error: stray '\240' in program
bits.cpp:19:1: error: stray '\302' in program
bits.cpp:19:1: error: stray '\240' in program
bits.cpp:20:1: error: stray '\302' in program
         n=n%int(pow(b,length-1-i));

 ^
bits.cpp:20:1: error: stray '\240' in program
bits.cpp:20:1: error: stray '\302' in program
bits.cpp:20:1: error: stray '\240' in program
bits.cpp:20:1: error: stray '\302' in program
bits.cpp:20:1: error: stray '\240' in program
bits.cpp:20:1: error: stray '\302' in program
bits.cpp:20:1: error: stray '\240' in program
bits.cpp:20:1: error: stray '\302' in program
bits.cpp:20:1: error: stray '\240' in program
bits.cpp:20:1: error: stray '\302' in program
bits.cpp:20:1: error: stray '\240' in program
bits.cpp:22:1: error: stray '\302' in program
         

 ^
bits.cpp:22:1: error: stray '\240' in program
bits.cpp:22:1: error: stray '\302' in program
bits.cpp:22:1: error: stray '\240' in program
bits.cpp:22:1: error: stray '\302' in program
bits.cpp:22:1: error: stray '\240' in program
bits.cpp:22:1: error: stray '\302' in program
bits.cpp:22:1: error: stray '\240' in program
bits.cpp:22:1: error: stray '\302' in program
bits.cpp:22:1: error: stray '\240' in program
bits.cpp:22:1: error: stray '\302' in program
bits.cpp:22:1: error: stray '\240' in program
bits.cpp:23:1: error: stray '\302' in program
     }

 ^
bits.cpp:23:1: error: stray '\240' in program
bits.cpp:23:1: error: stray '\302' in program
bits.cpp:23:1: error: stray '\240' in program
bits.cpp:23:1: error: stray '\302' in program
bits.cpp:23:1: error: stray '\240' in program
bits.cpp:24:1: error: stray '\302' in program
     cout<<res;

 ^
bits.cpp:24:1: error: stray '\240' in program
bits.cpp:24:1: error: stray '\302' in program
bits.cpp:24:1: error: stray '\240' in program
bits.cpp:24:1: error: stray '\302' in program
bits.cpp:24:1: error: stray '\240' in program
bits.cpp: In function 'int main()':
bits.cpp:7:15: warning: unused variable 'a' [-Wunused-variable]
     double a=3,c=4;

               ^
bits.cpp:7:19: warning: unused variable 'c' [-Wunused-variable]
     double a=3,c=4;

                   ^

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