### mistake in the code

i am expecting to get correct answer for every value of x, n and a[i] where
-10^9 <= a[i] <= 10^9
1 <= x <= 10^18
and 1 <= n <= 10000
every value here is an integer value
but i am wrong somewhere but dont know where

 ``1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071`` `````` #include #include #include #include #define sBig long long int using namespace std; sBig CONS = 1000000007; inline sBig mod(sBig a) { return (a%CONS+CONS)%CONS; } sBig a[10010], rem[10010]; int n; sBig solve(sBig x) { sBig temp = x; sBig num = 0; int s = 0; sBig z, tmp; bool sign; num = 0; num = mod(mod(x)*a[1]); int j = 2; for(; j <= n ; j++) { int nrt = floor(pow(x,1.0/(double)j)); if(nrt < 2) break; tmp = mod((nrt)*a[j]); num = mod(num + tmp); } sBig res = mod(num); if(n > 1) res = mod(num + rem[j]); return res; } main() { int q; sBig x; scanf("%d%d",&n,&q); rem[n+1] = 0; sBig z; for(int i = 1; i <= n; i++) { scanf("%lld",&a[i]); } for(int i = n; i > 0; i--) rem[i] = mod(rem[i+1] + a[i]); for(int i = 0; i < q ; i++) { scanf("%lld",&x); printf("%lld ",solve(x)); } return 0; } ``````
on line 45, should be
`int main()`
Topic archived. No new replies allowed.