  The origin of the stellar initial mass function (IMF) and its relation with
the core mass function (CMF) are actively debated issues with important
implications in astrophysics. Recent observations in the W43 molecular complex
of top-heavy CMFs, with an excess of high-mass cores compared to the canonical
mass distribution, raise questions about our understanding of the star
formation processes and their evolution in space and time. We aim to compare
populations of protostellar and prestellar cores in three regions imaged in the
ALMA-IMF Large Program. We created an homogeneous core catalogue in W43,
combining a new core extraction in W43-MM1 with the catalogue of W43-MM2&MM3
presented in a previous work. Our detailed search for protostellar outflows
enabled us to identify between 23 and 30 protostellar cores out of 127 cores in
W43-MM1 and between 42 and 51 protostellar cores out of 205 cores in
W43-MM2&MM3. Cores with neither outflows nor hot core emission are classified
as prestellar candidates. We found a similar fraction of cores which are
protostellar in the two regions, about 35%. This fraction strongly varies in
mass, from 15-20% at low mass, between 0.8 and 3$M_{\odot} $ up to about 80%
above 16$M_{\odot}$. Protostellar cores are found to be, on average, more
massive and smaller in size than prestellar cores. Our analysis also revealed
that the high-mass slope of the prestellar CMF in W43,
$\alpha=-1.46_{-0.19}^{+0.12}$, is consistent with the Salpeter slope, and thus
the top-heavy form measured for the global CMF, $\alpha=-0.96$, is due to the
protostellar core population. Our results could be explained by clump-fed
models in which cores grow in mass, especially during the protostellar phase,
through inflow from their environment. The difference between the slopes of the
prestellar and protostellar CMFs moreover implies that high-mass cores grow
more in mass than low-mass cores.
