#1330
PartitiiMultime
Fie n
un număr natural nenul și mulțimea A={1,2,3,...,n}
. Să se determine toate partițiile disjuncte ale mulțimii A
.
Problema | PartitiiMultime | Operații I/O |
partitiimultime.in /partitiimultime.out
|
---|---|---|---|
Limita timp | 0.2 secunde | Limita memorie |
Total: 2 MB
/
Stivă 2 MB
|
Id soluție | #53933400 | Utilizator | |
Fișier | partitiimultime.cpp | Dimensiune | 2.06 KB |
Data încărcării | 15 Noiembrie 2024, 09:28 | Scor / rezultat | Eroare de compilare |
partitiimultime.cpp:62:2: error: stray '#' in program }#include <fstream> ^ partitiimultime.cpp:4:1: error: expected ',' or ';' before 'ofstream' ofstream g("partitiimultime.out") ^ partitiimultime.cpp: In function 'void succesor(int, int&)': partitiimultime.cpp:9:8: error: 'st' was not declared in this scope if(st[k]<n) ^ partitiimultime.cpp:9:14: error: 'n' was not declared in this scope if(st[k]<n) ^ partitiimultime.cpp: In function 'void valid(int, int&)': partitiimultime.cpp:20:8: error: 'st' was not declared in this scope if(st[1]>1) ev=0; ^ partitiimultime.cpp:23:12: error: 'st' was not declared in this scope if(st[i]>mx) mx=st[i]; ^ partitiimultime.cpp:24:8: error: 'st' was not declared in this scope if(st[k]>mx+1) ev=0; ^ partitiimultime.cpp: In function 'int solutie(int)': partitiimultime.cpp:28:11: error: 'n' was not declared in this scope if(k==n) return 1; ^ partitiimultime.cpp: In function 'void tipar()': partitiimultime.cpp:35:21: error: 'n' was not declared in this scope for(int i=1; i<=n; i++) ^ partitiimultime.cpp:36:12: error: 'st' was not declared in this scope if(st[i]>mx) mx=st[i]; ^ partitiimultime.cpp:39:25: error: 'n' was not declared in this scope for(int j=1; j<=n; j++) ^ partitiimultime.cpp:40:15: error: 'st' was not declared in this scope if(st[j]==i) g<<j; ^ partitiimultime.cpp:40:25: error: 'g' was not declared in this scope if(st[j]==i) g<<j; ^ partitiimultime.cpp:41:9: error: 'g' was not declared in this scope g<<"*"; ^ partitiimultime.cpp:43:5: error: 'g' was not declared in this scope g<<endl; ^ partitiimultime.cpp: In function 'int main()': partitiimultime.cpp:47:8: error: 'n' was not declared in this scope f>>n; ^ partitiimultime.cpp:49:5: error: 'st' was not declared in this scope st[k]=0; ^ partitiimultime.cpp: At global scope: partitiimultime.cpp:62:3: error: 'include' does not name a type }#include <fstream> ^ partitiimultime.cpp:64:11: error: redefinition of 'std::ifstream f' ifstream f("partitiimultime.in"); ^ partitiimultime.cpp:3:10: error: 'std::ifstream f' previously declared here ifstream f("partitiimultime.in") ^ partitiimultime.cpp: In function 'void succesor(int, int&)': partitiimultime.cpp:68:6: error: redefinition of 'void succesor(int, int&)' void succesor(int k, int &as) ^ partitiimultime.cpp:7:6: error: 'void succesor(int, int&)' previously defined here void succesor(int k, int &as) ^ partitiimultime.cpp: In function 'void valid(int, int&)': partitiimultime.cpp:78:6: error: redefinition of 'void valid(int, int&)' void valid(int k, int &ev) ^ partitiimultime.cpp:17:6: error: 'void valid(int, int&)' previously defined here void valid(int k, int &ev) ^ partitiimultime.cpp: In function 'int solutie(int)': partitiimultime.cpp:87:5: error: redefinition of 'int solutie(int)' int solutie(int k) ^ partitiimultime.cpp:26:5: error: 'int solutie(int)' previously defined here int solutie(int k) ^ partitiimultime.cpp: In function 'void tipar()': partitiimultime.cpp:93:6: error: redefinition of 'void tipar()' void tipar() ^ partitiimultime.cpp:32:6: error: 'void tipar()' previously defined here void tipar() ^ partitiimultime.cpp: In function 'int main()': partitiimultime.cpp:106:5: error: redefinition of 'int main()' int main() ^ partitiimultime.cpp:45:5: error: 'int main()' previously defined here int main() ^ partitiimultime.cpp: In function 'int solutie(int)': partitiimultime.cpp:30:1: warning: control reaches end of non-void function [-Wreturn-type] } ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema PartitiiMultime 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ă.