#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 | #54180516 | Utilizator | |
Fișier | cerc.cpp | Dimensiune | 1.07 KB |
Data încărcării | 21 Noiembrie 2024, 13:51 | Scor / rezultat | Eroare de compilare |
cerc.cpp: In function 'void afisare()': cerc.cpp:9:9: error: reference to 'cout' is ambiguous cout << a[x[i]] << " "; ^ cerc.cpp:4:10: note: candidates are: std::ofstream cout ofstream cout("cerc.out"); ^ In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0, from cerc.cpp:1: /usr/include/c++/4.8/iostream:61:18: note: std::ostream std::cout extern ostream cout; /// Linked to standard output ^ cerc.cpp:10:5: error: reference to 'cout' is ambiguous cout << '\n'; ^ cerc.cpp:4:10: note: candidates are: std::ofstream cout ofstream cout("cerc.out"); ^ In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0, from cerc.cpp:1: /usr/include/c++/4.8/iostream:61:18: note: std::ostream std::cout extern ostream cout; /// Linked to standard output ^ cerc.cpp: In function 'int main()': cerc.cpp:42:5: error: reference to 'cin' is ambiguous cin >> n; ^ cerc.cpp:3:10: note: candidates are: std::ifstream cin ifstream cin("cerc.in"); ^ In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0, from cerc.cpp:1: /usr/include/c++/4.8/iostream:60:18: note: std::istream std::cin extern istream cin; /// Linked to standard input ^ cerc.cpp:44:9: error: reference to 'cin' is ambiguous cin >> a[i]; ^ cerc.cpp:3:10: note: candidates are: std::ifstream cin ifstream cin("cerc.in"); ^ In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0, from cerc.cpp:1: /usr/include/c++/4.8/iostream:60:18: note: std::istream std::cin extern istream cin; /// Linked to standard input ^ cerc.cpp:49:9: error: reference to 'cout' is ambiguous cout << a[rez[i]] << " "; ^ cerc.cpp:4:10: note: candidates are: std::ofstream cout ofstream cout("cerc.out"); ^ In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0, from cerc.cpp:1: /usr/include/c++/4.8/iostream:61:18: note: std::ostream std::cout extern ostream cout; /// Linked to standard output ^
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ă.