#682
partitie
Se consideră un număr natural N
și fie A
mulţimea tuturor numerelor naturale cuprinse între 1
şi N2
.
Numim partiție a mulțimii A
un set de submulțimi A1, A2, ..., AN
cu proprietățile:
N
submulțimi are ca rezultat mulțimea A
;Ai
, 1 ≤ i ≤ N
, este N
;Să se scrie un program care determină o partiție a mulțimii A
cu proprietăţile:
Ai
, 1 ≤ i ≤ N
, sunt egale;Ai
, 1 ≤ i ≤ N
, diferența oricăror două elemente succesive ale sale este diferită de N+1
și de N-1
;Problema | partitie | Operații I/O |
partitie.in /partitie.out
|
---|---|---|---|
Limita timp | 0.5 secunde | Limita memorie |
Total: 16 MB
/
Stivă 16 MB
|
Id soluție | #45352480 | Utilizator | |
Fișier | partitie.cpp | Dimensiune | 440 B |
Data încărcării | 10 Octombrie 2023, 13:15 | Scor / rezultat | Eroare de compilare |
partitie.cpp:11:1: error: stray '\342' in program cout<<„Solutia nr. „<< ns<<” : „; ^ partitie.cpp:11:1: error: stray '\200' in program partitie.cpp:11:1: error: stray '\236' in program partitie.cpp:11:1: error: stray '\342' in program partitie.cpp:11:1: error: stray '\200' in program partitie.cpp:11:1: error: stray '\236' in program partitie.cpp:11:1: error: stray '\342' in program partitie.cpp:11:1: error: stray '\200' in program partitie.cpp:11:1: error: stray '\235' in program partitie.cpp:11:1: error: stray '\342' in program partitie.cpp:11:1: error: stray '\200' in program partitie.cpp:11:1: error: stray '\236' in program partitie.cpp:13:1: error: stray '\342' in program for(i=1;i<=l;i++) cout<<sol[i]<<” „; ^ partitie.cpp:13:1: error: stray '\200' in program partitie.cpp:13:1: error: stray '\235' in program partitie.cpp:13:1: error: stray '\342' in program partitie.cpp:13:1: error: stray '\200' in program partitie.cpp:13:1: error: stray '\236' in program partitie.cpp:49:1: error: stray '\342' in program cout<<ns<<” solutii”; ^ partitie.cpp:49:1: error: stray '\200' in program partitie.cpp:49:1: error: stray '\235' in program partitie.cpp:49:1: error: stray '\342' in program partitie.cpp:49:1: error: stray '\200' in program partitie.cpp:49:1: error: stray '\235' in program partitie.cpp: In function 'void afis(int)': partitie.cpp:11:1: error: 'cout' was not declared in this scope cout<<„Solutia nr. „<< ns<<” : „; ^ partitie.cpp:11:1: note: suggested alternative: In file included from partitie.cpp:1:0: /usr/include/c++/4.8/iostream:61:18: note: 'std::cout' extern ostream cout; /// Linked to standard output ^ partitie.cpp:11:10: error: 'Solutia' was not declared in this scope cout<<„Solutia nr. „<< ns<<” : „; ^ partitie.cpp:11:18: error: expected ';' before 'nr' cout<<„Solutia nr. „<< ns<<” : „; ^ partitie.cpp:13:40: error: expected primary-expression before ';' token for(i=1;i<=l;i++) cout<<sol[i]<<” „; ^ partitie.cpp:15:7: error: 'endl' was not declared in this scope cout<<endl; ^ partitie.cpp:15:7: note: suggested alternative: In file included from /usr/include/c++/4.8/iostream:39:0, from partitie.cpp:1: /usr/include/c++/4.8/ostream:564:5: note: 'std::endl' endl(basic_ostream<_CharT, _Traits>& __os) ^ partitie.cpp: At global scope: partitie.cpp:39:11: error: '::main' must return 'int' void main() ^ partitie.cpp: In function 'int main()': partitie.cpp:43:1: error: 'cin' was not declared in this scope cin>>n; ^ partitie.cpp:43:1: note: suggested alternative: In file included from partitie.cpp:1:0: /usr/include/c++/4.8/iostream:60:18: note: 'std::cin' extern istream cin; /// Linked to standard input ^ partitie.cpp:49:1: error: 'cout' was not declared in this scope cout<<ns<<” solutii”; ^ partitie.cpp:49:1: note: suggested alternative: In file included from partitie.cpp:1:0: /usr/include/c++/4.8/iostream:61:18: note: 'std::cout' extern ostream cout; /// Linked to standard output ^ partitie.cpp:49:15: error: 'solutii' was not declared in this scope cout<<ns<<” solutii”; ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema partitie 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ă.