#2556
hn
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 | #46799039 | Utilizator | |
Fișier | hn.cpp | Dimensiune | 3.33 KB |
Data încărcării | 23 Noiembrie 2023, 09:50 | Scor / rezultat | Eroare de compilare |
hn.cpp:33:30: error: expected identifier before '__int128' void operator *= (NrMare &x, __int128 a) ^ hn.cpp:33:30: error: expected ',' or '...' before '__int128' hn.cpp: In function 'void operator*=(NrMare&, int)': hn.cpp:35:5: error: expected primary-expression before '__int128' __int128 trans = 0; ^ hn.cpp:35:5: error: expected ';' before '__int128' hn.cpp:38:9: error: 'trans' was not declared in this scope trans += (a * x.nr[i]); ^ hn.cpp:38:19: error: 'a' was not declared in this scope trans += (a * x.nr[i]); ^ hn.cpp:42:11: error: 'trans' was not declared in this scope while(trans) ^ hn.cpp: At global scope: hn.cpp:60:30: error: expected identifier before '__int128' void operator /= (NrMare &x, __int128 a) ^ hn.cpp:60:30: error: expected ',' or '...' before '__int128' hn.cpp: In function 'void operator/=(NrMare&, int)': hn.cpp:62:5: error: expected primary-expression before '__int128' __int128 trans = 0; ^ hn.cpp:62:5: error: expected ';' before '__int128' hn.cpp:65:9: error: 'trans' was not declared in this scope trans += x.nr[i]; ^ hn.cpp:66:28: error: 'a' was not declared in this scope x.nr[i] = (trans / a); ^ hn.cpp: At global scope: hn.cpp:75:31: error: expected identifier before '__int128' NrMare operator / (NrMare &x, __int128 a) ^ hn.cpp:75:31: error: expected ',' or '...' before '__int128' hn.cpp: In function 'NrMare operator/(NrMare&, int)': hn.cpp:79:5: error: expected primary-expression before '__int128' __int128 trans = 0; ^ hn.cpp:79:5: error: expected ';' before '__int128' hn.cpp:82:9: error: 'trans' was not declared in this scope trans += x.nr[i]; ^ hn.cpp:83:30: error: 'a' was not declared in this scope ans.nr[i] = (trans / a); ^ hn.cpp:89:8: error: 'trans' was not declared in this scope if(trans == 0) ^ hn.cpp: In function 'int main()': hn.cpp:118:13: error: expected primary-expression before '__int128' __int128 turip = 1; ^ hn.cpp:118:13: error: expected ';' before '__int128' hn.cpp:119:19: error: 'turip' was not declared in this scope while(turip * i < (__int128)LONG_LONG_MAX * LONG_LONG_MAX / baza) ^ hn.cpp:119:32: error: expected primary-expression before '__int128' while(turip * i < (__int128)LONG_LONG_MAX * LONG_LONG_MAX / baza) ^ hn.cpp:119:32: error: expected ')' before '__int128' hn.cpp:120:27: error: expected ')' before ';' token turip *= i; ^ hn.cpp:123:21: error: 'turip' was not declared in this scope q / turip; ^ hn.cpp:132:13: error: 'turip' was not declared in this scope turip = (1LL * i * i * i * i * i); ^
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ă.