0_0_20612955_23972.cpp:5:5: error: 'mod' does not name a type
mod)f[i]%=mod; } while(scanf("%lld%lld",&n,&m)&&(n+m)>0) { ll ans=1; if(n<m||m==1||m==2) { while(n>0) { if(n&1)ans*=m; if(ans>mod)ans%=mod; n>>=1; m*=m; if(m>mod)m%=mod; } } else { ans=f[m]+m; if(ans>mod)ans%=mod; } printf("%lld\n",ans); } return 0;}
^
0_0_20612955_23972.cpp:5:23: error: expected declaration before '}' token
mod)f[i]%=mod; } while(scanf("%lld%lld",&n,&m)&&(n+m)>0) { ll ans=1; if(n<m||m==1||m==2) { while(n>0) { if(n&1)ans*=m; if(ans>mod)ans%=mod; n>>=1; m*=m; if(m>mod)m%=mod; } } else { ans=f[m]+m; if(ans>mod)ans%=mod; } printf("%lld\n",ans); } return 0;}
^
|