#2646
Se dau n numere naturale, unde n este un număr par. Se grupează cele n numere în perechi şi pentru fiecare pereche de numere se află restul împărţirii unui număr din pereche la celălalt. Se cere să se afle valoarea minimă a sumei acestor resturi.
| Problema | impartire | Operații I/O |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 2 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64741335 | Utilizator | |
| Fișier | impartire.cpp | Dimensiune | 1.21 KB |
| Data încărcării | 27 Mai 2026, 09:50 | Scor/rezultat | Eroare de compilare |
impartire.cpp: In function ‘int main()’: impartire.cpp:12:5: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] 12 | for(int i=0;i<n;i++) | ^~~ impartire.cpp:15:9: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’ 15 | for(int i=0;i<n;i++) | ^~~ impartire.cpp:41:17: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] 41 | for(int i=0;i<n;i+=2) | ^~~ impartire.cpp:44:21: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’ 44 | if(s<minl) | ^~ impartire.cpp:44:21: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation] impartire.cpp:47:25: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’ 47 | o--; | ^ impartire.cpp:50:33: error: expected ‘;’ before ‘continue’ 50 | b[o] | ^ | ; 51 | 52 | continue; | ~~~~~~~~ impartire.cpp:50:32: warning: statement has no effect [-Wunused-value] 50 | b[o] | ~~~^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema impartire 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ă.