#1239
Dându-se n
fracții ireducitibile sortate crescător și un număr k
să se determine numărul de subșiruri de exact k
elemente în care diferența dintre două fracții consecutive este egală cu 1
. De asemenea, prima fracție din subșir trebuie să nu fie supraunitara.
Problema | Fractii3 | Operații I/O |
![]() fractii3.in /fractii3.out
|
---|---|---|---|
Limita timp | 0.52 secunde | Limita memorie |
Total: 16 MB
/
Stivă 4 MB
|
Id soluție | #57899724 | Utilizator | |
Fișier | fractii3.cpp | Dimensiune | 2.02 KB |
Data încărcării | 29 Aprilie 2025, 20:59 | Scor / rezultat | Eroare de compilare |
fractii3.cpp:42:2: error: stray '#' in program }#include <fstream> ^ fractii3.cpp:42:3: error: 'include' does not name a type }#include <fstream> ^ fractii3.cpp:46:14: error: redefinition of 'std::ifstream fin' ifstream fin ("fractii3.in"); ^ fractii3.cpp:5:10: error: 'std::ifstream fin' previously declared here ifstream fin ("fractii3.in"); ^ fractii3.cpp:47:15: error: redefinition of 'std::ofstream fout' ofstream fout ("fractii3.out"); ^ fractii3.cpp:6:10: error: 'std::ofstream fout' previously declared here ofstream fout ("fractii3.out"); ^ fractii3.cpp:49:5: error: redefinition of 'int n' int n, k, a, b, i, sol; ^ fractii3.cpp:8:5: error: 'int n' previously declared here int n, k, a, b, i, sol; ^ fractii3.cpp:49:8: error: redefinition of 'int k' int n, k, a, b, i, sol; ^ fractii3.cpp:8:8: error: 'int k' previously declared here int n, k, a, b, i, sol; ^ fractii3.cpp:49:11: error: redefinition of 'int a' int n, k, a, b, i, sol; ^ fractii3.cpp:8:11: error: 'int a' previously declared here int n, k, a, b, i, sol; ^ fractii3.cpp:49:14: error: redefinition of 'int b' int n, k, a, b, i, sol; ^ fractii3.cpp:8:14: error: 'int b' previously declared here int n, k, a, b, i, sol; ^ fractii3.cpp:49:17: error: redefinition of 'int i' int n, k, a, b, i, sol; ^ fractii3.cpp:8:17: error: 'int i' previously declared here int n, k, a, b, i, sol; ^ fractii3.cpp:49:20: error: redefinition of 'int sol' int n, k, a, b, i, sol; ^ fractii3.cpp:8:20: error: 'int sol' previously declared here int n, k, a, b, i, sol; ^ fractii3.cpp:51:26: error: redefinition of 'std::queue<std::pair<int, int> > Q' queue <pair <int, int> > Q; ^ fractii3.cpp:10:26: error: 'std::queue<std::pair<int, int> > Q' previously declared here queue <pair <int, int> > Q; ^ fractii3.cpp: In function 'int frcmp(std::pair<int, int>, std::pair<int, int>)': fractii3.cpp:53:5: error: redefinition of 'int frcmp(std::pair<int, int>, std::pair<int, int>)' int frcmp(pair <int, int> a, pair <int, int> b) { ^ fractii3.cpp:12:5: error: 'int frcmp(std::pair<int, int>, std::pair<int, int>)' previously defined here int frcmp(pair <int, int> a, pair <int, int> b) { ^ fractii3.cpp: In function 'int main()': fractii3.cpp:61:5: error: redefinition of 'int main()' int main() { ^ fractii3.cpp:20:5: error: 'int main()' previously defined here int main() { ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Fractii3 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ă.