#2485
Se consideră N, un număr natural nenul. Dorim să-l scriem pe N ca sumă a două numere naturale nenule x și y, astfel încât suma cifrelor numerelor x și y să fie maximă. Scrieţi un program care să rezolve următoarele cerinţe:
1. să determine suma maximă a cifrelor a două numere x și y cu proprietatea că x+y=N;
2. să determine două numere naturale nenule xmax și ymax cu proprietatea că xmax≥ymax, xmax+ymax=N, suma cifrelor lor este maximă, iar diferența xmax-ymax este maximă;
3. să determine două numere naturale nenule xmin și ymin cu proprietatea că xmin≥ymin, xmin+ymin=N, suma cifrelor lor este maximă, iar diferența xmin-ymin este minimă.
| Problema | nxy | Operații I/O |
nxy.in/nxy.out
|
|---|---|---|---|
| Limita timp | 0.2 secunde | Limita memorie |
Total: 8 MB
/
Stivă 8 MB
|
| Id soluție | #62909458 | Utilizator | |
| Fișier | nxy.py3 | Dimensiune | 811 B |
| Data încărcării | 05 Februarie 2026, 23:53 | Scor/rezultat | 0 puncte |
| Test | Timp | Mesaj evaluare | Scor posibil | Scor obținut | ||
|---|---|---|---|---|---|---|
| 3 | 0.012 secunde | Exited with error status 1 | 1 | 0 | ||
| 4 | 0.012 secunde | Exited with error status 1 | 2 | 0 | ||
| 5 | 0.012 secunde | Exited with error status 1 | 2 | 0 | ||
| 6 | 0.012 secunde | Exited with error status 1 | 1 | 0 | ||
| 7 | 0.012 secunde | Exited with error status 1 | 2 | 0 | ||
| 8 | 0.012 secunde | Exited with error status 1 | 2 | 0 | ||
| 9 | 0.012 secunde | Exited with error status 1 | 1 | 0 | ||
| 10 | 0.012 secunde | Exited with error status 1 | 2 | 0 | ||
| 11 | 0.012 secunde | Exited with error status 1 | 2 | 0 | ||
| 12 | 0.012 secunde | Exited with error status 1 | 1 | 0 | ||
| 13 | 0.012 secunde | Exited with error status 1 | 2 | 0 | ||
| 14 | 0.012 secunde | Exited with error status 1 | 2 | 0 | ||
| 15 | 0.012 secunde | Exited with error status 1 | 1 | 0 | ||
| 16 | 0.012 secunde | Exited with error status 1 | 2 | 0 | ||
| 17 | 0.012 secunde | Exited with error status 1 | 2 | 0 | ||
| 18 | 0.012 secunde | Exited with error status 1 | 1 | 0 | ||
| 19 | 0.012 secunde | Exited with error status 1 | 2 | 0 | ||
| 20 | 0.012 secunde | Exited with error status 1 | 2 | 0 | ||
| 21 | 0.012 secunde | Exited with error status 1 | 1 | 0 | ||
| 22 | 0.012 secunde | Exited with error status 1 | 2 | 0 | ||
| 23 | 0.012 secunde | Exited with error status 1 | 2 | 0 | ||
| 24 | 0.012 secunde | Exited with error status 1 | 1 | 0 | ||
| 25 | 0.012 secunde | Exited with error status 1 | 2 | 0 | ||
| 26 | 0.012 secunde | Exited with error status 1 | 2 | 0 | ||
| 27 | 0.012 secunde | Exited with error status 1 | 1 | 0 | ||
| 28 | 0.012 secunde | Exited with error status 1 | 2 | 0 | ||
| 29 | 0.012 secunde | Exited with error status 1 | 2 | 0 | ||
| 30 | 0.012 secunde | Exited with error status 1 | 1 | 0 | ||
| 31 | 0.012 secunde | Exited with error status 1 | 2 | 0 | ||
| 32 | 0.012 secunde | Exited with error status 1 | 2 | 0 | ||
| 33 | 0.012 secunde | Exited with error status 1 | 1 | 0 | ||
| 34 | 0.012 secunde | Exited with error status 1 | 2 | 0 | ||
| 35 | 0.012 secunde | Exited with error status 1 | 2 | 0 | ||
| 36 | 0.012 secunde | Exited with error status 1 | 1 | 0 | ||
| 37 | 0.012 secunde | Exited with error status 1 | 2 | 0 | ||
| 38 | 0.012 secunde | Exited with error status 1 | 2 | 0 | ||
| 39 | 0.012 secunde | Exited with error status 1 | 1 | 0 | ||
| 40 | 0.012 secunde | Exited with error status 1 | 2 | 0 | ||
| 41 | 0.012 secunde | Exited with error status 1 | 2 | 0 | ||
| 42 | 0.012 secunde | Exited with error status 1 | 1 | 0 | ||
| 43 | 0.012 secunde | Exited with error status 1 | 2 | 0 | ||
| 44 | 0.012 secunde | Exited with error status 1 | 2 | 0 | ||
| 45 | 0.016 secunde | Exited with error status 1 | 1 | 0 | ||
| 46 | 0.016 secunde | Exited with error status 1 | 2 | 0 | ||
| 47 | 0.016 secunde | Exited with error status 1 | 2 | 0 | ||
| 48 | 0.016 secunde | Exited with error status 1 | 1 | 0 | ||
| 49 | 0.012 secunde | Exited with error status 1 | 2 | 0 | ||
| 50 | 0.016 secunde | Exited with error status 1 | 2 | 0 | ||
| 51 | 0.012 secunde | Exited with error status 1 | 1 | 0 | ||
| 52 | 0.016 secunde | Exited with error status 1 | 2 | 0 | ||
| 53 | 0.016 secunde | Exited with error status 1 | 2 | 0 | ||
| 54 | 0.016 secunde | Exited with error status 1 | 1 | 0 | ||
| 55 | 0.016 secunde | Exited with error status 1 | 2 | 0 | ||
| 56 | 0.016 secunde | Exited with error status 1 | 2 | 0 | ||
| 57 | 0.012 secunde | Exited with error status 1 | 1 | 0 | ||
| 58 | 0.012 secunde | Exited with error status 1 | 2 | 0 | ||
| 59 | 0.016 secunde | Exited with error status 1 | 2 | 0 | ||
| 60 | 0.016 secunde | Exited with error status 1 | 1 | 0 | ||
| 61 | 0.016 secunde | Exited with error status 1 | 2 | 0 | ||
| 62 | 0.016 secunde | Exited with error status 1 | 2 | 0 | ||
| Punctaj total | 0 | |||||
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema nxy 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ă.