#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 | #56200900 | Utilizator | |
| Fișier | hn.cpp | Dimensiune | 2.95 KB |
| Data încărcării | 10 Februarie 2025, 11:05 | Scor/rezultat | 100 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:68:30: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for (i = 0; i < a.c.size() or tr; i++) ^ hn.cpp:70: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:89: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.016 secunde | OK. | 3 | 3 | ||
| 16 | 0.016 secunde | OK. | 3 | 3 | ||
| 17 | 0.024 secunde | OK. | 3 | 3 | ||
| 18 | 0.028 secunde | OK. | 3 | 3 | ||
| 19 | 0.044 secunde | OK. | 3 | 3 | ||
| 20 | 0.044 secunde | OK. | 3 | 3 | ||
| 21 | 0.068 secunde | OK. | 3 | 3 | ||
| 22 | 0.104 secunde | OK. | 3 | 3 | ||
| 23 | 0.124 secunde | OK. | 3 | 3 | ||
| 24 | 0.172 secunde | OK. | 4 | 4 | ||
| Punctaj total | 100 | |||||
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ă.