#3943
Cerc5
Se dă numărul natural n
. Determinati o modalitate de așezare a numerelor din mulțimea \({1,2,…,n}\) pe un cerc astfel încât suma a oricare două nume învecinate să fie pătrat perfect.
Problema | Cerc5 | Operații I/O | tastatură/ecran |
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #42855198 | Utilizator | |
Fișier | cerc5.cpp | Dimensiune | 1.07 KB |
Data încărcării | 20 Martie 2023, 13:33 | Scor / rezultat | Eroare de compilare |
cerc5.cpp: In function 'void afisare()': cerc5.cpp:9:9: error: reference to 'cout' is ambiguous cout << a[x[i]] << " "; ^ cerc5.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 cerc5.cpp:1: /usr/include/c++/4.8/iostream:61:18: note: std::ostream std::cout extern ostream cout; /// Linked to standard output ^ cerc5.cpp:10:5: error: reference to 'cout' is ambiguous cout << '\n'; ^ cerc5.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 cerc5.cpp:1: /usr/include/c++/4.8/iostream:61:18: note: std::ostream std::cout extern ostream cout; /// Linked to standard output ^ cerc5.cpp: In function 'int main()': cerc5.cpp:42:5: error: reference to 'cin' is ambiguous cin >> n; ^ cerc5.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 cerc5.cpp:1: /usr/include/c++/4.8/iostream:60:18: note: std::istream std::cin extern istream cin; /// Linked to standard input ^ cerc5.cpp:44:9: error: reference to 'cin' is ambiguous cin >> a[i]; ^ cerc5.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 cerc5.cpp:1: /usr/include/c++/4.8/iostream:60:18: note: std::istream std::cin extern istream cin; /// Linked to standard input ^ cerc5.cpp:49:9: error: reference to 'cout' is ambiguous cout << a[rez[i]] << " "; ^ cerc5.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 cerc5.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 Cerc5 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ă.