Help needed

What is difference in code 1:https://www.codechef.com/viewsolution/21304270 and code 2:https://www.codechef.com/viewsolution/21304405 both code is entirely same except storing the value of variable ans please help me out.

//