#318
Cerc
Se dau n
numere naturale. Determinaţi o aranjare a acestor numere pe un cerc, astfel încât suma produselor de câte două numere vecine să fie maximă.
Problema | Cerc | Operații I/O |
cerc.in /cerc.out
|
---|---|---|---|
Limita timp | 0.2 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #41508983 | Utilizator | |
Fișier | cerc.cpp | Dimensiune | 901 B |
Data încărcării | 26 Ianuarie 2023, 13:37 | Scor / rezultat | Eroare de compilare |
cerc.cpp:4:1: error: 'ifsteam' does not name a type ifsteam fin("cerc.in"); ^ cerc.cpp:5:1: error: 'ofsteam' does not name a type ofsteam fout("cerc.out"); ^ cerc.cpp: In function 'bool calcmin()': cerc.cpp:18:18: error: 'sol' was not declared in this scope r[i]=sol[i]; ^ cerc.cpp:20:1: warning: no return statement in function returning non-void [-Wreturn-type] } ^ cerc.cpp: In function 'bool isok(int, int)': cerc.cpp:25:12: error: 'sol' was not declared in this scope if(sol[i]==vsl) ^ cerc.cpp:25:20: error: 'vsl' was not declared in this scope if(sol[i]==vsl) ^ cerc.cpp:26:8: error: 'fals' was not declared in this scope return fals; ^ cerc.cpp: In function 'void bac(int)': cerc.cpp:40:13: error: 'sol' was not declared in this scope sol[pas]=V[i]; ^ cerc.cpp: In function 'int main()': cerc.cpp:48:5: error: 'fin' was not declared in this scope fin>>n; ^ cerc.cpp:51:15: error: 'sort' was not declared in this scope sort(V,V+n); ^ cerc.cpp:54:5: error: 'fout' was not declared in this scope fout<<r[i]; ^ cerc.cpp: In function 'bool isok(int, int)': cerc.cpp:29:1: warning: control reaches end of non-void function [-Wreturn-type] } ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Cerc 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ă.