spoj Weight wa plz help

,

problem :http://www.spoj.com/problems/WEIGHT/
sol: ideone.com/XKDKGK

Brother, my implementation : http://ideone.com/zD2vLZ & http://ideone.com/Rzz3yl

1 Like

would you please explain the algorithm used in http://ideone.com/zD2vLZ

Brother, till line : 37 fast I/O method has been implemented, after that it’s easy as you can see.

2 Likes