#4096
Un palilindrom este un număr natural pentru care există o bâlbâială a regelui care îl transformă într-un palindrom. Spre exemplu, 25373552 este un palilindrom, pentru că după o bâlbâială poate deveni 255373552, acesta fiind un număr palindrom. Fiind dat un număr natural nenul X să se determine:
X după o bâlbâială și câte numere diferite pot deveni X după o bâlbâială.X. Nu este obligatoriu să se folosească toate cifrele lui X.OJI 2022 clasa a IX-a
| Problema | balba | Operații I/O |
balba.in/balba.out
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64488572 | Utilizator | |
| Fișier | balba.cpp | Dimensiune | 2.08 KB |
| Data încărcării | 10 Mai 2026, 20:54 | Scor/rezultat | Eroare de compilare |
balba.cpp:5:19: error: conflicting declaration ‘int f [12]’ 5 | int n,y,c,x,a,b,k,f[12],o,p,v,r; | ^ balba.cpp:3:10: note: previous declaration as ‘std::ifstream f’ 3 | ifstream f("balba.in"); | ^ balba.cpp: In function ‘int main()’: balba.cpp:13:10: error: no match for ‘operator[]’ (operand types are ‘std::ifstream’ {aka ‘std::basic_ifstream<char>’} and ‘int’) 13 | f[x]++; | ^ balba.cpp:30:17: error: no match for ‘operator[]’ (operand types are ‘std::ifstream’ {aka ‘std::basic_ifstream<char>’} and ‘int’) 30 | if(f[i]%2) | ^ balba.cpp:36:18: error: no match for ‘operator[]’ (operand types are ‘std::ifstream’ {aka ‘std::basic_ifstream<char>’} and ‘int’) 36 | f[i]=0; | ^ balba.cpp:37:17: error: no match for ‘operator[]’ (operand types are ‘std::ifstream’ {aka ‘std::basic_ifstream<char>’} and ‘int’) 37 | if(f[i]>3 and f[i]%2==0 and o==-2 and a<1) | ^ balba.cpp:37:28: error: no match for ‘operator[]’ (operand types are ‘std::ifstream’ {aka ‘std::basic_ifstream<char>’} and ‘int’) 37 | if(f[i]>3 and f[i]%2==0 and o==-2 and a<1) | ^ balba.cpp:38:22: error: no match for ‘operator[]’ (operand types are ‘std::ifstream’ {aka ‘std::basic_ifstream<char>’} and ‘int’) 38 | p=i,f[i]--; | ^ balba.cpp:39:17: error: no match for ‘operator[]’ (operand types are ‘std::ifstream’ {aka ‘std::basic_ifstream<char>’} and ‘int’) 39 | if(f[i]%2==0) | ^ balba.cpp:41:20: error: no match for ‘operator[]’ (operand types are ‘std::ifstream’ {aka ‘std::basic_ifstream<char>’} and ‘int’) 41 | k=f[i]/2; | ^ balba.cpp:44:18: error: no match for ‘operator[]’ (operand types are ‘std::ifstream’ {aka ‘std::basic_ifstream<char>’} and ‘int’) 44 | f[i]/=2; | ^ balba.cpp:48:41: error: no match for ‘operator[]’ (operand types are ‘std::ifstream’ {aka ‘std::basic_ifstream<char>’} and ‘int’) 48 | if((o==-2 or r==0) and f[i]>1) | ^ balba.cpp:50:24: error: no match for ‘operator[]’ (operand types are ‘std::ifstream’ {aka ‘std::basic_ifstream<char>’} and ‘int’) 50 | k=f[i]/2+1; | ^ balba.cpp:51:22: error: no match for ‘operator[]’ (operand types are ‘std::ifstream’ {aka ‘std::basic_ifstream<char>’} and ‘int’) 51 | f[i]=f[i]-k; | ^ balba.cpp:51:27: error: no match for ‘operator[]’ (operand types are ‘std::ifstream’ {aka ‘std::basic_ifstream<char>’} and ‘int’) 51 | f[i]=f[i]-k; | ^ balba.cpp:60:45: error: no match for ‘operator[]’ (operand types are ‘std::ifstream’ {aka ‘std::basic_ifstream<char>’} and ‘int’) 60 | else if(o==-1 or(o==-2 and f[i]==1)) | ^ balba.cpp:63:22: error: no match for ‘operator[]’ (operand types are ‘std::ifstream’ {aka ‘std::basic_ifstream<char>’} and ‘int’) 63 | f[i]--; | ^ balba.cpp:64:24: error: no match for ‘operator[]’ (operand types are ‘std::ifstream’ {aka ‘std::basic_ifstream<char>’} and ‘int’) 64 | k=f[i]/2; | ^ balba.cpp:67:22: error: no match for ‘operator[]’ (operand types are ‘std::ifstream’ {aka ‘std::basic_ifstream<char>’} and ‘int’) 67 | f[i]/=2; | ^ balba.cpp:71:22: error: no match for ‘operator[]’ (operand types are ‘std::ifstream’ {aka ‘std::basic_ifstream<char>’} and ‘int’) 71 | f[i]--; | ^ balba.cpp:72:24: error: no match for ‘operator[]’ (operand types are ‘std::ifstream’ {aka ‘std::basic_ifstream<char>’} and ‘int’) 72 | k=f[i]/2; | ^ balba.cpp:75:22: error: no match for ‘operator[]’ (operand types are ‘std::ifstream’ {aka ‘std::basic_ifstream<char>’} and ‘int’) 75 | f[i]/=2; | ^ balba.cpp:89:16: error: no match for ‘operator[]’ (operand types are ‘std::ifstream’ {aka ‘std::basic_ifstream<char>’} and ‘int’) 89 | k=f[i]; | ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema balba 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ă.