Блог пользователя twarzo

Автор twarzo, 11 лет назад, По-английски

I am getting wrong answer in http://www.spoj.com/problems/FIBFUNCH/ Please somebody help.

include<stdio.h>

int main() { long long int t,n,x,y,s=0,m,i=0; scanf("%lld",&t); while(t--) {s=0; scanf("%lld%lld%lld%lld",&x,&y,&n,&m); s=(x%m+y%m)%m; for(i=2;i<n;i++) { y=x+y; x=y-x; s+=(y%m); s%=m; } printf("%lld\n",s); } return 0; }

  • Проголосовать: нравится
  • -11
  • Проголосовать: не нравится

»
11 лет назад, # |
  Проголосовать: нравится +8 Проголосовать: не нравится

Sorry, but nobody there want to read ur code and try to find a mistake. Better if u will show to us the idea of ur solution. After that, may be, someone will ask to u :)