#4496
Se dau două numere naturale n și m. Determinati o modalitate alegere de m numere din mulțimea \({1,2,…,n}\) și de așezare a lor pe un cerc astfel încât suma a oricare două nume învecinate să fie pătrat perfect.
| Problema | Cerc_nm | Operații I/O |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 0.9 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64340670 | Utilizator | |
| Fișier | cerc_nm.cpp | Dimensiune | 637 B |
| Data încărcării | 30 Aprilie 2026, 13:46 | Scor/rezultat | Eroare de compilare |
cerc_nm.cpp: In function ‘void backt(int)’: cerc_nm.cpp:17:21: error: expected ‘;’ before ‘este’ 17 | for(int j=1;j<=n este==0;j++) | ^~~~~ | ; cerc_nm.cpp:17:26: warning: for increment expression has no effect [-Wunused-value] 17 | for(int j=1;j<=n este==0;j++) | ~~~~^~~ cerc_nm.cpp:17:29: error: expected ‘)’ before ‘;’ token 17 | for(int j=1;j<=n este==0;j++) | ~ ^ | ) cerc_nm.cpp:17:5: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] 17 | for(int j=1;j<=n este==0;j++) | ^~~ cerc_nm.cpp:17:30: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’ 17 | for(int j=1;j<=n este==0;j++) | ^ cerc_nm.cpp:16:5: warning: this ‘else’ clause does not guard... [-Wmisleading-indentation] 16 | else | ^~~~ cerc_nm.cpp:17:30: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘else’ 17 | for(int j=1;j<=n este==0;j++) | ^ cerc_nm.cpp:17:30: error: ‘j’ was not declared in this scope
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Cerc_nm 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ă.