#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 | #52736219 | Utilizator | |
Fișier | cerc.cpp | Dimensiune | 1.00 KB |
Data încărcării | 08 Octombrie 2024, 11:03 | Scor / rezultat | Eroare de compilare |
cerc.cpp:6:16: warning: missing terminating " character [enabled by default] ofstream fout ("cerc.out); ^ cerc.cpp:6:1: error: missing terminating " character ofstream fout ("cerc.out); ^ cerc.cpp:8:13: error: 'a' has not been declared int x[100], a[100], n, y[100]; ^ cerc.cpp:8:21: error: 'n' has not been declared int x[100], a[100], n, y[100]; ^ cerc.cpp:8:24: error: 'y' has not been declared int x[100], a[100], n, y[100]; ^ cerc.cpp:8:30: error: expected ')' before ';' token int x[100], a[100], n, y[100]; ^ cerc.cpp: In function 'int valid(int)': cerc.cpp:15:13: error: 'x' was not declared in this scope if (x[i]==x[k]) return 0; ^ cerc.cpp: In function 'void backk(int)': cerc.cpp:23:18: error: 'n' was not declared in this scope for (i=1; i<=n; i++) ^ cerc.cpp:25:9: error: 'x' was not declared in this scope x[k]=i; ^ cerc.cpp:30:23: error: 'a' was not declared in this scope s=a[x[1]]*a[x[n]]; ^ cerc.cpp:35:29: error: 'y' was not declared in this scope y[l]=a[x[l]]; ^ cerc.cpp:26:12: warning: suggest explicit braces to avoid ambiguous 'else' [-Wparentheses] if (valid(k)) ^ cerc.cpp: In function 'int main()': cerc.cpp:46:12: error: 'n' was not declared in this scope fin >> n; ^ cerc.cpp:47:33: error: 'a' was not declared in this scope for (i=1; i<=n; i++) fin >> a[i]; ^ cerc.cpp:48:10: error: 'a' was not declared in this scope sort(a+1,a+n+1); ^ cerc.cpp:48:19: error: 'sort' was not declared in this scope sort(a+1,a+n+1); ^ cerc.cpp:50:34: error: 'y' was not declared in this scope for (i=1; i<=n; i++) fout << y[i] << " "; ^
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ă.