#2556
Fie N un număr natural și expresia \( H_N = 1 + \frac{1}{2} + \frac{1}{3} + … + \frac{1}{N}\). Determinați numerele naturale P și Q ce reprezintă numărătorul respectiv numitorul fracției ireductibile \( H_N = \frac{P}{Q}\).
Balcaniada de Informatică 2018, ziua 1
| Problema | hn | Operații I/O |
hn.in/hn.out
|
|---|---|---|---|
| Limita timp | 0.2 secunde | Limita memorie |
Total: 128 MB
/
Stivă 32 MB
|
| Id soluție | #56200798 | Utilizator | |
| Fișier | hn.cpp | Dimensiune | 2.81 KB |
| Data încărcării | 10 Februarie 2025, 11:01 | Scor/rezultat | 96 puncte |
hn.cpp: In function 'huge operator+(huge&, huge&)': hn.cpp:38:30: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for (i = 0; i < a.c.size() or i < b.c.size() or tr; i++) ^ hn.cpp:38:48: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for (i = 0; i < a.c.size() or i < b.c.size() or tr; i++) ^ hn.cpp:40:26: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] if (i < a.c.size()) ^ hn.cpp:42:26: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] if (i < b.c.size()) ^ hn.cpp: In function 'huge operator*(huge, int)': hn.cpp:60:30: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for (i = 0; i < a.c.size() or tr; i++) ^ hn.cpp:62:26: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] if (i < a.c.size()) ^ hn.cpp: In function 'int operator%(huge&, int)': hn.cpp:81:30: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for (i = 0; i < a.c.size(); i++) ^
| Test | Timp | Mesaj evaluare | Scor posibil | Scor obținut | ||
|---|---|---|---|---|---|---|
| 0 | 0 secunde | OK. | 9 | 9 | ||
| 1 | 0 secunde | OK. | 11 | 11 | ||
| 2 | 0 secunde | OK. | 13 | 13 | ||
| 3 | 0 secunde | OK. | 2 | 2 | ||
| 4 | 0 secunde | OK. | 2 | 2 | ||
| 5 | 0 secunde | OK. | 2 | 2 | ||
| 6 | 0 secunde | OK. | 3 | 3 | ||
| 7 | 0 secunde | OK. | 3 | 3 | ||
| 8 | 0 secunde | OK. | 3 | 3 | ||
| 9 | 0 secunde | OK. | 3 | 3 | ||
| 10 | 0 secunde | OK. | 4 | 4 | ||
| 11 | 0 secunde | OK. | 4 | 4 | ||
| 12 | 0.004 secunde | OK. | 4 | 4 | ||
| 13 | 0.008 secunde | OK. | 3 | 3 | ||
| 14 | 0.008 secunde | OK. | 3 | 3 | ||
| 15 | 0.02 secunde | OK. | 3 | 3 | ||
| 16 | 0.02 secunde | OK. | 3 | 3 | ||
| 17 | 0.032 secunde | OK. | 3 | 3 | ||
| 18 | 0.04 secunde | OK. | 3 | 3 | ||
| 19 | 0.06 secunde | OK. | 3 | 3 | ||
| 20 | 0.06 secunde | OK. | 3 | 3 | ||
| 21 | 0.088 secunde | OK. | 3 | 3 | ||
| 22 | 0.14 secunde | OK. | 3 | 3 | ||
| 23 | 0.164 secunde | OK. | 3 | 3 | ||
| 24 | Depășit | Limita de timp depășită | 4 | 0 | ||
| Punctaj total | 96 | |||||
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema hn 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ă.