#514
Se dă un vector cu n elemente, numere naturale. Afișați în ordine descrescătoare valorile din vector care sunt prime cu ultimul element al vectorului.
| Problema | SortPIE | Operații I/O |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64280898 | Utilizator | |
| Fișier | sortpie.cpp | Dimensiune | 1009 B |
| Data încărcării | 27 Aprilie 2026, 20:02 | Scor/rezultat | 100 puncte |
sortpie.cpp: In function ‘void intercls(int, int, int)’: sortpie.cpp:15:7: warning: this ‘while’ clause does not guard... [-Wmisleading-indentation] 15 | while(j<=dr) | ^~~~~ sortpie.cpp:17:9: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘while’ 17 | for(i=1,j=st;j<=dr;i++,j++) | ^~~ sortpie.cpp: In function ‘int prime(int, int)’: sortpie.cpp:32:5: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation] 32 | if(x<2) | ^~ sortpie.cpp:34:9: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’ 34 | if(y%x==0 || x%y==0) | ^~ sortpie.cpp:37:17: warning: left operand of comma operator has no effect [-Wunused-value] 37 | for(i=2; i*i<=x,i*i<=y;i++) | ~~~^~~ sortpie.cpp: In function ‘int main()’: sortpie.cpp:45:5: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] 45 | for(int i=0;i<n;i++) | ^~~ sortpie.cpp:47:9: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’ 47 | v[n]=v[n-1]; | ^
| Test | Timp | Mesaj evaluare | Scor posibil | Scor obținut | ||
|---|---|---|---|---|---|---|
| 1 | 0.001 secunde | OK. | 20 | 20 | Exemplu | |
| 2 | 0.002 secunde | OK. | 40 | 40 | ||
| 3 | 0.031 secunde | OK. | 40 | 40 | ||
| Punctaj total | 100 | |||||
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema SortPIE 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ă.