### dunjen_master's blog

By dunjen_master, history, 18 months ago,

Her is the link to my submission on which i got WA at pretest 11 https://codeforces.com/contest/1139/submission/51643042

I just uncommented the line ans=(ans+mod)%mod and it got accpeted although in the previous line i had done ans=(? -ans +mod)%mod.

Someone please explain me why did my code failed at test 11 ?

• 0

 » 18 months ago, # |   0 codefor(int i=1;i<=n;i++){ if(i!=root(Arr,i))continue; ans+=power(size[i],k*1LL);}In your last loop you should add ans%=(MOD) ; as it will overflow;