#4398
Un număr se numește palindrom dacă citit de la stânga la dreapta este identic cu numărul citit de la dreapta la stânga. Un număr care nu este palindrom poate fi transformat în palindrom adăugând la dreapta sa una sau mai multe cifre. Dat fiind un șir de n numere naturale, scrieți un program care să rezolve următoarele două cerințe:
1. să se determine numărul minim total de cifre care trebuie să fie adăugate, astfel încât fiecare valoare din șir să fie palindrom;
2. considerând că putem adăuga cel mult S cifre, să se determine numărul maxim de termeni palindrom aflați pe poziții consecutive în șirul obținut.
OJI 2023, clasa a VII-a
| Problema | palindrom4 | Operații I/O |
palindrom.in/palindrom.out
|
|---|---|---|---|
| Limita timp | 0.3 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #61263994 | Utilizator | |
| Fișier | palindrom4.cpp | Dimensiune | 1.80 KB |
| Data încărcării | 22 Noiembrie 2025, 17:59 | Scor/rezultat | 0 puncte |
| Test | Timp | Mesaj evaluare | Scor posibil | Scor obținut | ||
|---|---|---|---|---|---|---|
| 1 | 0 secunde | Exited with error status 10 | 5 | 0 | ||
| 2 | 0 secunde | Exited with error status 10 | 5 | 0 | ||
| 3 | 0 secunde | Exited with error status 10 | 5 | 0 | ||
| 4 | 0 secunde | Exited with error status 10 | 5 | 0 | ||
| 5 | 0 secunde | Exited with error status 10 | 5 | 0 | ||
| 6 | 0 secunde | Exited with error status 10 | 3 | 0 | ||
| 7 | 0 secunde | Exited with error status 10 | 3 | 0 | ||
| 8 | 0 secunde | Exited with error status 10 | 3 | 0 | ||
| 9 | 0 secunde | Exited with error status 10 | 4 | 0 | ||
| 10 | 0 secunde | Exited with error status 10 | 4 | 0 | ||
| 11 | 0 secunde | Exited with error status 10 | 4 | 0 | ||
| 12 | 0.004 secunde | Exited with error status 10 | 4 | 0 | ||
| 13 | 0.004 secunde | Exited with error status 10 | 4 | 0 | ||
| 14 | 0.096 secunde | Exited with error status 10 | 4 | 0 | ||
| 15 | 0.176 secunde | Exited with error status 10 | 4 | 0 | ||
| 16 | 0.236 secunde | Exited with error status 10 | 4 | 0 | ||
| 17 | 0.236 secunde | Exited with error status 10 | 4 | 0 | ||
| 18 | 0.472 secunde | Exited with error status 10 | 4 | 0 | ||
| 19 | 0.476 secunde | Exited with error status 10 | 4 | 0 | ||
| 20 | 0.628 secunde | Exited with error status 10 | 4 | 0 | ||
| 21 | 0.628 secunde | Exited with error status 10 | 4 | 0 | ||
| 22 | 0.636 secunde | Exited with error status 10 | 5 | 0 | ||
| 23 | 0.64 secunde | Exited with error status 10 | 4 | 0 | ||
| 24 | 0.624 secunde | Exited with error status 10 | 5 | 0 | ||
| Punctaj total | 0 | |||||
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema palindrom4 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ă.