#303
Eratostene
Se dau n
numere naturale mai mici decât 1.000.000
. Determinaţi câte dintre ele sunt prime.
Problema | Eratostene | Operații I/O |
eratostene.in /eratostene.out
|
---|---|---|---|
Limita timp | 0.5 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #16534256 | Utilizator | |
Fișier | eratostene.cpp | Dimensiune | 631 B |
Data încărcării | 27 August 2019, 23:37 | Scor / rezultat | Eroare de compilare |
eratostene.cpp:14:2: error: stray '\302' in program ifstream f("eratostene.in"); ^ eratostene.cpp:14:2: error: stray '\240' in program eratostene.cpp:16:2: error: stray '\302' in program ofstream g("eratostene.out"); ^ eratostene.cpp:16:2: error: stray '\240' in program eratostene.cpp:18:2: error: stray '\302' in program int n, i, j, nrp=0, m=1000000; ^ eratostene.cpp:18:2: error: stray '\240' in program eratostene.cpp:20:2: error: stray '\302' in program f>>n; ^ eratostene.cpp:20:2: error: stray '\240' in program eratostene.cpp:22:2: error: stray '\302' in program for (i=1; i<=n; ++i) f>>b[i]; ^ eratostene.cpp:22:2: error: stray '\240' in program eratostene.cpp:26:2: error: stray '\302' in program for (i = 2; i <= m; i++) ^ eratostene.cpp:26:2: error: stray '\240' in program eratostene.cpp:26:2: error: stray '\302' in program eratostene.cpp:26:2: error: stray '\240' in program eratostene.cpp:28:2: error: stray '\302' in program a[i] = 1; ^ eratostene.cpp:28:2: error: stray '\240' in program eratostene.cpp:28:2: error: stray '\302' in program eratostene.cpp:28:2: error: stray '\240' in program eratostene.cpp:28:2: error: stray '\302' in program eratostene.cpp:28:2: error: stray '\240' in program eratostene.cpp:28:2: error: stray '\302' in program eratostene.cpp:28:2: error: stray '\240' in program eratostene.cpp:30:2: error: stray '\302' in program for (i = 2; i*i <= m; i++) ^ eratostene.cpp:30:2: error: stray '\240' in program eratostene.cpp:30:2: error: stray '\302' in program eratostene.cpp:30:2: error: stray '\240' in program eratostene.cpp:32:2: error: stray '\302' in program if (a[i]!=0) ^ eratostene.cpp:32:2: error: stray '\240' in program eratostene.cpp:32:2: error: stray '\302' in program eratostene.cpp:32:2: error: stray '\240' in program eratostene.cpp:32:2: error: stray '\302' in program eratostene.cpp:32:2: error: stray '\240' in program eratostene.cpp:32:2: error: stray '\302' in program eratostene.cpp:32:2: error: stray '\240' in program eratostene.cpp:34:2: error: stray '\302' in program for (j = 2; j <= m / i; j++) ^ eratostene.cpp:34:2: error: stray '\240' in program eratostene.cpp:34:2: error: stray '\302' in program eratostene.cpp:34:2: error: stray '\240' in program eratostene.cpp:34:2: error: stray '\302' in program eratostene.cpp:34:2: error: stray '\240' in program eratostene.cpp:34:2: error: stray '\302' in program eratostene.cpp:34:2: error: stray '\240' in program eratostene.cpp:34:2: error: stray '\302' in program eratostene.cpp:34:2: error: stray '\240' in program eratostene.cpp:34:2: error: stray '\302' in program eratostene.cpp:34:2: error: stray '\240' in program eratostene.cpp:36:2: error: stray '\302' in program a[i*j] = 0; ^ eratostene.cpp:36:2: error: stray '\240' in program eratostene.cpp:36:2: error: stray '\302' in program eratostene.cpp:36:2: error: stray '\240' in program eratostene.cpp:36:2: error: stray '\302' in program eratostene.cpp:36:2: error: stray '\240' in program eratostene.cpp:36:2: error: stray '\302' in program eratostene.cpp:36:2: error: stray '\240' in program eratostene.cpp:36:2: error: stray '\302' in program eratostene.cpp:36:2: error: stray '\240' in program eratostene.cpp:36:2: error: stray '\302' in program eratostene.cpp:36:2: error: stray '\240' in program eratostene.cpp:36:2: error: stray '\302' in program eratostene.cpp:36:2: error: stray '\240' in program eratostene.cpp:36:2: error: stray '\302' in program eratostene.cpp:36:2: error: stray '\240' in program eratostene.cpp:38:2: error: stray '\302' in program ^ eratostene.cpp:38:2: error: stray '\240' in program eratostene.cpp:38:2: error: stray '\302' in program eratostene.cpp:38:2: error: stray '\240' in program eratostene.cpp:40:2: error: stray '\302' in program for (i = 1; i <= n; i++) ^ eratostene.cpp:40:2: error: stray '\240' in program eratostene.cpp:40:2: error: stray '\302' in program eratostene.cpp:40:2: error: stray '\240' in program eratostene.cpp:42:2: error: stray '\302' in program if (a[b[i]] == 1) ++nrp; ^ eratostene.cpp:42:2: error: stray '\240' in program eratostene.cpp:42:2: error: stray '\302' in program eratostene.cpp:42:2: error: stray '\240' in program eratostene.cpp:42:2: error: stray '\302' in program eratostene.cpp:42:2: error: stray '\240' in program eratostene.cpp:42:2: error: stray '\302' in program eratostene.cpp:42:2: error: stray '\240' in program eratostene.cpp:48:2: error: stray '\302' in program g << nrp; ^ eratostene.cpp:48:2: error: stray '\240' in program eratostene.cpp:48:2: error: stray '\302' in program eratostene.cpp:48:2: error: stray '\240' in program eratostene.cpp:50:2: error: stray '\302' in program return 0; ^ eratostene.cpp:50:2: error: stray '\240' in program eratostene.cpp:50:2: error: stray '\302' in program eratostene.cpp:50:2: error: stray '\240' in program
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Eratostene 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ă.