getting wa rrecipe help

tried many test cases but getting wa

my soln: http://www.codechef.com/viewsolution/3469354

problem link: http://www.codechef.com/problems/RRECIPE/

ur getting WA because of integer overflow .take the modulus at each step (i.e r=(r * 26)%MOD) here is ur modified soln i just changed r=r * 26%MOD .got AC

1 Like