  In this paper we study the $p$-adic equation $x^q=a$ over the field of
$p$-adic numbers. We construct an algorithm of calculation of criteria of
solvability in the case of $q=p^m$ and present a computer program to compute
the criteria for fixed value of $m \leq p-1$. Moreover, using this solvability
criteria for $q=2,3,4,5,6$, we classify $p$-adic 6-dimensional filiform Leibniz
algebras.
