#2239
Se consideră un șir a[1]
, a[2]
,…, a[n]
de numere naturale nenule. Să se determine câte perechi de indici (i, j)
, 1 ≤ i < j ≤ n
, există cu proprietatea că suma a[i] + a[j]
este egală cu o putere a lui 2
.
-
Problema | pow2 | Operații I/O |
![]() |
---|---|---|---|
Limita timp | 0.3 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #58233839 | Utilizator | |
Fișier | pow2.cpp | Dimensiune | 1.23 KB |
Data încărcării | 21 Mai 2025, 15:35 | Scor / rezultat | 70 puncte |
pow2.cpp:4:250: warning: narrowing conversion of '4294967296ll' from 'long long int' to 'unsigned int' inside { } [-Wnarrowing] unsigned int pows[35] ={1,2,4,8,16,32,64,128,256,512,1024,2048,4096,8192,16384,32768,65536,131072,262144l,524288,1048576,2097152, 4194304,8388608,16777216,33554432,67108864,134217728,268435456,536870912,1073741824,2147483648 ,4294967296,8589934592}; ^ pow2.cpp:4:250: warning: large integer implicitly truncated to unsigned type [-Woverflow] pow2.cpp:4:250: warning: narrowing conversion of '8589934592ll' from 'long long int' to 'unsigned int' inside { } [-Wnarrowing] pow2.cpp:4:250: warning: large integer implicitly truncated to unsigned type [-Woverflow]
Test | Timp | Mesaj evaluare | Scor posibil | Scor obținut | ||
---|---|---|---|---|---|---|
0 | 0 secunde | OK. | 10 | 10 | ||
1 | 0 secunde | OK. | 10 | 10 | ||
2 | 0 secunde | OK. | 10 | 10 | ||
3 | 0.004 secunde | OK. | 10 | 10 | ||
4 | 0.02 secunde | OK. | 10 | 10 | ||
5 | 0.252 secunde | OK. | 10 | 10 | ||
6 | Depășit | Limita de timp depășită | 10 | 0 | ||
7 | Depășit | Limita de timp depășită | 10 | 0 | ||
8 | 0.26 secunde | OK. | 10 | 10 | ||
9 | Depășit | Limita de timp depășită | 10 | 0 | ||
Punctaj total | 70 |
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema pow2 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ă.