#3792
nfrac
Fie a
și b
două numere naturale 0 < a ≤ b
. Să se determine numărul de fracții \( \frac{x}{y} \) diferite, ce se pot forma utilizând numere naturale nenule, având proprietățile: \( \frac{a}{b} \leq \frac{x}{y} \leq \frac{b}{a} \) și 2 ≤ x + y ≤ a + b
.
Concursul Național Info Pro, Etapa II
Problema | nfrac | Operații I/O |
nfrac.in /nfrac.out
|
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #54112986 | Utilizator | |
Fișier | nfrac.cpp | Dimensiune | 803 B |
Data încărcării | 20 Noiembrie 2024, 08:05 | Scor / rezultat | Eroare de compilare |
nfrac.cpp: In function 'void interclasare()': nfrac.cpp:5:5: error: 'ifstream' was not declared in this scope ifstream cin("file1.txt"); ^ nfrac.cpp:5:5: note: suggested alternative: In file included from /usr/include/c++/4.8/ios:38:0, from /usr/include/c++/4.8/istream:38, from /usr/include/c++/4.8/fstream:38, from nfrac.cpp:1: /usr/include/c++/4.8/iosfwd:157:34: note: 'std::ifstream' typedef basic_ifstream<char> ifstream; ^ nfrac.cpp:5:14: error: expected ';' before 'cin' ifstream cin("file1.txt"); ^ nfrac.cpp:6:11: error: expected ';' before 'cin2' ifstream cin2("file2.txt"); ^ nfrac.cpp:7:2: error: 'ofstream' was not declared in this scope ofstream cout("file.out"); ^ nfrac.cpp:7:2: note: suggested alternative: In file included from /usr/include/c++/4.8/ios:38:0, from /usr/include/c++/4.8/istream:38, from /usr/include/c++/4.8/fstream:38, from nfrac.cpp:1: /usr/include/c++/4.8/iosfwd:160:34: note: 'std::ofstream' typedef basic_ofstream<char> ofstream; ^ nfrac.cpp:7:11: error: expected ';' before 'cout' ofstream cout("file.out"); ^ nfrac.cpp:11:5: error: 'cin' was not declared in this scope cin >> n; ^ nfrac.cpp:12:5: error: 'cin2' was not declared in this scope cin2 >> m; ^ nfrac.cpp:24:13: error: 'cout' was not declared in this scope cout << x << " "; ^ nfrac.cpp:32:13: error: 'cout' was not declared in this scope cout << y << " "; ^ nfrac.cpp:43:9: error: 'cout' was not declared in this scope cout << x << " "; ^ nfrac.cpp:52:9: error: 'cout' was not declared in this scope cout << y << " "; ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema nfrac 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ă.