#2336
primcolor
Dorel are o nouă pasiune, să coloreze divizorii unui număr natural. Primind cadou de ziua lui un număr natural n
, s-a gândit să coloreze toate numerele naturale de la 1
la n
cu câte o culoare, astfel încât toţi divizorii proprii ai unui număr să aibă aceeaşi culoare cu numărul. Vă roagă pe voi să aflaţi care este numărul maxim de culori care pot fi folosite.
Problema | primcolor | Operații I/O |
primcolor.in /primcolor.out
|
---|---|---|---|
Limita timp | 0.7 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #53933501 | Utilizator | |
Fișier | primcolor.cpp | Dimensiune | 585 B |
Data încărcării | 15 Noiembrie 2024, 09:29 | Scor / rezultat | Eroare de compilare |
primcolor.cpp: In function 'int main()': primcolor.cpp:13:5: error: reference to 'cin' is ambiguous cin >> n; ^ primcolor.cpp:4:10: note: candidates are: std::ifstream cin ifstream cin("primcolor.in"); ^ In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0, from primcolor.cpp:1: /usr/include/c++/4.8/iostream:60:18: note: std::istream std::cin extern istream cin; /// Linked to standard input ^ primcolor.cpp:14:15: error: reference to 'cout' is ambiguous if(n == 1)cout << 1; ^ primcolor.cpp:5:10: note: candidates are: std::ofstream cout ofstream cout("primcolor.out"); ^ In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0, from primcolor.cpp:1: /usr/include/c++/4.8/iostream:61:18: note: std::ostream std::cout extern ostream cout; /// Linked to standard output ^ primcolor.cpp:15:20: error: reference to 'cout' is ambiguous else if(n == 2)cout << 2; ^ primcolor.cpp:5:10: note: candidates are: std::ofstream cout ofstream cout("primcolor.out"); ^ In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0, from primcolor.cpp:1: /usr/include/c++/4.8/iostream:61:18: note: std::ostream std::cout extern ostream cout; /// Linked to standard output ^ primcolor.cpp:16:20: error: reference to 'cout' is ambiguous else if(n == 3)cout << 3; ^ primcolor.cpp:5:10: note: candidates are: std::ofstream cout ofstream cout("primcolor.out"); ^ In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0, from primcolor.cpp:1: /usr/include/c++/4.8/iostream:61:18: note: std::ostream std::cout extern ostream cout; /// Linked to standard output ^ primcolor.cpp:17:20: error: reference to 'cout' is ambiguous else if(n == 4)cout << 3; ^ primcolor.cpp:5:10: note: candidates are: std::ofstream cout ofstream cout("primcolor.out"); ^ In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0, from primcolor.cpp:1: /usr/include/c++/4.8/iostream:61:18: note: std::ostream std::cout extern ostream cout; /// Linked to standard output ^ primcolor.cpp:22:9: error: reference to 'cout' is ambiguous cout << cnt; ^ primcolor.cpp:5:10: note: candidates are: std::ofstream cout ofstream cout("primcolor.out"); ^ In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0, from primcolor.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 primcolor 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ă.