Study of CP-violating asymmetries in B0→π+π-, K+π- decays