#4707
Se consideră trei numere naturale n, k și d. Să se determine cel mai mic număr natural care se poate obține prin interschimbarea ultimelor k cifre ale lui n astfel încât numărul obținut să fie divizibil cu d.
Concursul Judetean XOR 2014
| Problema | nkd | Operații I/O |
nkd.in/nkd.out
|
|---|---|---|---|
| Limita timp | 0.5 secunde | Limita memorie |
Total: 4 MB
/
Stivă 1 MB
|
| Id soluție | #64939594 | Utilizator | |
| Fișier | nkd.cpp | Dimensiune | 2.18 KB |
| Data încărcării | 18 Iunie 2026, 10:24 | Scor/rezultat | 0 puncte |
nkd.cpp: In function ‘bool backtrack(bnum&, int, int, std::vector<int>&, std::vector<int>&, int, int)’: nkd.cpp:50:12: warning: comparison of integer expressions of different signedness: ‘int’ and ‘std::vector<int>::size_type’ {aka ‘long unsigned int’} [-Wsign-compare] 50 | if(idx >= sol.size()){ | ~~~~^~~~~~~~~~~~~ nkd.cpp:64:22: warning: comparison of integer expressions of different signedness: ‘int’ and ‘std::vector<int>::size_type’ {aka ‘long unsigned int’} [-Wsign-compare] 64 | for(int i = 0; i < nums.size(); i++){ | ~~^~~~~~~~~~~~~
| Test | Timp | Mesaj evaluare | Scor posibil | Scor obținut | ||
|---|---|---|---|---|---|---|
| 0 | 0.001 secunde | Raspuns gresit. | 5 | 0 | ||
| 1 | 0.001 secunde | Raspuns gresit. | 5 | 0 | ||
| 2 | 0.002 secunde | Raspuns gresit. | 10 | 0 | ||
| 3 | 0.002 secunde | Raspuns gresit. | 10 | 0 | ||
| 4 | 0.001 secunde | Raspuns gresit. | 10 | 0 | ||
| 5 | 0.001 secunde | Raspuns gresit. | 10 | 0 | ||
| 6 | 0.001 secunde | Raspuns gresit. | 10 | 0 | ||
| 7 | 0.001 secunde | Raspuns gresit. | 10 | 0 | ||
| 8 | 0.002 secunde | Raspuns gresit. | 10 | 0 | ||
| 9 | 0.001 secunde | Raspuns gresit. | 10 | 0 | ||
| 10 | 0.001 secunde | Raspuns gresit. | 10 | 0 | ||
| Punctaj total | 0 | |||||
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema nkd 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ă.