  We investigate the heavy flavor dynamics in the quark-gluon plasma (QGP)
medium created in p-Pb collisions at the CERN Large Hadron Collider (LHC). In
the (3+1)-dimensional viscous hydrodynamics model describing QGP medium, the
dynamics of heavy quarks are studied in an improved Langevin framework
incorporating both collisional and radiative energy loss. The hadronization of
the heavy quarks is given by a hybrid model of fragmentation and recombination.
We find that the in-medium evolution of charm quarks raises the D-meson
$R_{pPb}$ at low transverse momenta while it suppresses the D-meson $R_{pPb}$
at intermediate momenta. In addition, the elliptic flow of D-meson is
calculated. For a diffusion coefficient which reproduces central $R_{AA}$ data
at the LHC, we find a much smaller D-meson $v_2$ compared to the light hadrons.
This observation indicates an incomplete coupling between heavy quarks with the
medium, due to the reduced medium size compared to AA collisions.
