#2621
spower2
Un număr natural M
se numește număr spower2 dacă poate fi descompus astfel: M=2
x
+2
y
, cu x≠y
. Exemplu: 6
este un număr spower2 (6=2+4
), pe când 8
nu este.
Cerința
Se consideră un șir A
de n
numere naturale. Pentru fiecare element al șirului A
i
să se determine cel mai apropiat număr spower2 mai mare sau egal cu A
i
, unde 1≤i≤n
.
Problema | spower2 | Operații I/O |
spower2.in /spower2.out
|
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 4 MB
/
Stivă 2 MB
|
Id soluție | #49504101 | Utilizator | |
Fișier | spower2.cpp | Dimensiune | 734 B |
Data încărcării | 04 Martie 2024, 22:46 | Scor / rezultat | Eroare de compilare |
spower2.cpp:3:18: error: declaration does not declare anything [-fpermissive] #define int long long; ^ spower2.cpp:5:1: note: in expansion of macro 'int' int v[35], sp[10001]; ^ spower2.cpp:5:5: error: 'v' does not name a type int v[35], sp[10001]; ^ spower2.cpp:3:18: error: declaration does not declare anything [-fpermissive] #define int long long; ^ spower2.cpp:8:1: note: in expansion of macro 'int' int main () ^ spower2.cpp:8:11: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] int main () ^ spower2.cpp: In function 'int main()': spower2.cpp:3:18: error: declaration does not declare anything [-fpermissive] #define int long long; ^ spower2.cpp:10:5: note: in expansion of macro 'int' int n, m, i, nr=0; ^ spower2.cpp:10:9: error: 'n' was not declared in this scope int n, m, i, nr=0; ^ spower2.cpp:10:12: error: 'm' was not declared in this scope int n, m, i, nr=0; ^ spower2.cpp:10:15: error: 'i' was not declared in this scope int n, m, i, nr=0; ^ spower2.cpp:10:18: error: 'nr' was not declared in this scope int n, m, i, nr=0; ^ spower2.cpp:11:5: error: 'v' was not declared in this scope v[1]=1 ^ spower2.cpp:12:5: error: expected ';' before 'for' for (i=2; i<=33; i++) ^ spower2.cpp:12:25: error: expected ';' before ')' token for (i=2; i<=33; i++) ^ spower2.cpp:15:14: error: 'j' was not declared in this scope for (j=1; j<=33; j++) ^ spower2.cpp:16:9: error: 'sp' was not declared in this scope sp[++nr]=v[i]+v[j]; ^ spower2.cpp:3:18: error: declaration does not declare anything [-fpermissive] #define int long long; ^ spower2.cpp:20:9: note: in expansion of macro 'int' int x; ^ spower2.cpp:20:13: error: 'x' was not declared in this scope int x; ^ spower2.cpp:3:18: error: declaration does not declare anything [-fpermissive] #define int long long; ^ spower2.cpp:22:9: note: in expansion of macro 'int' int st=1, dr=nr, retine=0; ^ spower2.cpp:22:13: error: 'st' was not declared in this scope int st=1, dr=nr, retine=0; ^ spower2.cpp:22:19: error: 'dr' was not declared in this scope int st=1, dr=nr, retine=0; ^ spower2.cpp:22:26: error: 'retine' was not declared in this scope int st=1, dr=nr, retine=0; ^ spower2.cpp:3:18: error: declaration does not declare anything [-fpermissive] #define int long long; ^ spower2.cpp:25:13: note: in expansion of macro 'int' int mij=(st+dr)/2; ^ spower2.cpp:25:17: error: 'mij' was not declared in this scope int mij=(st+dr)/2; ^ spower2.cpp:26:17: error: 'sp' was not declared in this scope if (sp[mij]>=x) ^ spower2.cpp:33:14: error: 'sp' was not declared in this scope g << sp[retine] << ' ' ; ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema spower2 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ă.