#3525
soft_prime
Se dă un şir format din n
numere naturale nenule distincte. Afişaţi numerele prime din şir, în ordine crescătoare.
Problema | soft_prime | Operații I/O |
soft_prime.in /soft_prime.out
|
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 0.1 MB
/
Stivă 0.1 MB
|
Id soluție | #54998687 | Utilizator | |
Fișier | soft_prime.cpp | Dimensiune | 876 B |
Data încărcării | 15 Decembrie 2024, 20:41 | Scor / rezultat | Eroare de compilare |
soft_prime.cpp: In function 'int main()': soft_prime.cpp:25:25: error: no match for call to '(main()::__lambda4) (int [10500], int&)' if(isPrime(i)) sb(s, i); ^ soft_prime.cpp:20:13: note: candidates are: auto sb = [](char *p, int i){ int j = i-i/2-i/3+i/6-1; p[j>>5] |= 1<<(j&31); }; ^ soft_prime.cpp:25:25: note: void (*)(char*, int) <conversion> if(isPrime(i)) sb(s, i); ^ soft_prime.cpp:25:25: note: candidate expects 3 arguments, 3 provided soft_prime.cpp:20:29: note: main()::__lambda4 auto sb = [](char *p, int i){ int j = i-i/2-i/3+i/6-1; p[j>>5] |= 1<<(j&31); }; ^ soft_prime.cpp:20:29: note: no known conversion for argument 1 from 'int [10500]' to 'char*' soft_prime.cpp:29:38: error: no match for call to '(main()::__lambda5) (int [10500], int&)' if(i>4 && (i&1) && (i%3) && gb(s, i)) sb(p, i); ^ soft_prime.cpp:21:13: note: candidates are: auto gb = [](char *p, int i){ int j = i-i/2-i/3+i/6-1; return p[j>>5] & (1<<(j&31)); }; ^ soft_prime.cpp:29:38: note: int (*)(char*, int) <conversion> if(i>4 && (i&1) && (i%3) && gb(s, i)) sb(p, i); ^ soft_prime.cpp:29:38: note: candidate expects 3 arguments, 3 provided soft_prime.cpp:21:29: note: main()::__lambda5 auto gb = [](char *p, int i){ int j = i-i/2-i/3+i/6-1; return p[j>>5] & (1<<(j&31)); }; ^ soft_prime.cpp:21:29: note: no known conversion for argument 1 from 'int [10500]' to 'char*' soft_prime.cpp:29:48: error: no match for call to '(main()::__lambda4) (int [10500], int&)' if(i>4 && (i&1) && (i%3) && gb(s, i)) sb(p, i); ^ soft_prime.cpp:20:13: note: candidates are: auto sb = [](char *p, int i){ int j = i-i/2-i/3+i/6-1; p[j>>5] |= 1<<(j&31); }; ^ soft_prime.cpp:29:48: note: void (*)(char*, int) <conversion> if(i>4 && (i&1) && (i%3) && gb(s, i)) sb(p, i); ^ soft_prime.cpp:29:48: note: candidate expects 3 arguments, 3 provided soft_prime.cpp:20:29: note: main()::__lambda4 auto sb = [](char *p, int i){ int j = i-i/2-i/3+i/6-1; p[j>>5] |= 1<<(j&31); }; ^ soft_prime.cpp:20:29: note: no known conversion for argument 1 from 'int [10500]' to 'char*' soft_prime.cpp:32:31: error: no match for call to '(main()::__lambda5) (int [10500], int&)' if((i&1) && (i%3) && gb(p, i)) fo<<i<<' '; ^ soft_prime.cpp:21:13: note: candidates are: auto gb = [](char *p, int i){ int j = i-i/2-i/3+i/6-1; return p[j>>5] & (1<<(j&31)); }; ^ soft_prime.cpp:32:31: note: int (*)(char*, int) <conversion> if((i&1) && (i%3) && gb(p, i)) fo<<i<<' '; ^ soft_prime.cpp:32:31: note: candidate expects 3 arguments, 3 provided soft_prime.cpp:21:29: note: main()::__lambda5 auto gb = [](char *p, int i){ int j = i-i/2-i/3+i/6-1; return p[j>>5] & (1<<(j&31)); }; ^ soft_prime.cpp:21:29: note: no known conversion for argument 1 from 'int [10500]' to 'char*'
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema soft_prime 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ă.