#1931
Definim un număr ca fiind fantastic dacă numărul de numere la care acesta se împarte exact este un număr prim.
Dându-se un șir cu n numere întregi strict pozitive, să se afișeze numărul de numere fantastice din șir.
Moisil++, 2016
| Problema | Fantastice | Operații I/O |
fantastice.in/fantastice.out
|
|---|---|---|---|
| Limita timp | 1 secunde | Limita memorie |
Total: 16 MB
/
Stivă 8 MB
|
| Id soluție | #64122018 | Utilizator | |
| Fișier | fantastice.cpp | Dimensiune | 544 B |
| Data încărcării | 18 Aprilie 2026, 15:26 | Scor/rezultat | 100 puncte |
fantastice.cpp: In function ‘int main()’: fantastice.cpp:19:10: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare] 19 | for(j=2;j<=nr;j++) c[j]=1; | ~^~~~ fantastice.cpp:20:12: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare] 20 | for(j=2;j*j<=nr;j++) | ~~~^~~~ fantastice.cpp:22:12: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare] 22 | for(k=j*j;k<=nr;k=k+j) c[k]=0; | ~^~~~
| Test | Timp | Mesaj evaluare | Scor posibil | Scor obținut | ||
|---|---|---|---|---|---|---|
| 0 | 0.001 secunde | OK. | 5 | 5 | ||
| 1 | 0.001 secunde | OK. | 5 | 5 | ||
| 2 | 0.001 secunde | OK. | 5 | 5 | ||
| 3 | 0.001 secunde | OK. | 5 | 5 | ||
| 4 | 0.001 secunde | OK. | 5 | 5 | ||
| 5 | 0.001 secunde | OK. | 5 | 5 | ||
| 6 | 0.001 secunde | OK. | 5 | 5 | ||
| 7 | 0.001 secunde | OK. | 5 | 5 | ||
| 8 | 0.002 secunde | OK. | 5 | 5 | ||
| 9 | 0.002 secunde | OK. | 5 | 5 | ||
| 10 | 0.007 secunde | OK. | 5 | 5 | ||
| 11 | 0.004 secunde | OK. | 5 | 5 | ||
| 12 | 0.008 secunde | OK. | 5 | 5 | ||
| 13 | 0.021 secunde | OK. | 5 | 5 | ||
| 14 | 0.043 secunde | OK. | 5 | 5 | ||
| 15 | 0.04 secunde | OK. | 5 | 5 | ||
| 16 | 0.06 secunde | OK. | 5 | 5 | ||
| 17 | 0.18 secunde | OK. | 5 | 5 | ||
| 18 | 0.298 secunde | OK. | 5 | 5 | ||
| 19 | 0.402 secunde | OK. | 5 | 5 | ||
| Punctaj total | 100 | |||||
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Fantastice face parte din prima categorie. Soluția propusă de tine va fi evaluată astfel:
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ă.