Skip to content

Instantly share code, notes, and snippets.

@buyoh
Last active February 19, 2016 17:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save buyoh/795505808dd657893701 to your computer and use it in GitHub Desktop.
Save buyoh/795505808dd657893701 to your computer and use it in GitHub Desktop.
// http://d.hatena.ne.jp/Ozy/20160202
long long a=1,b[9],s;main(z){for(;99+z;a=(b[z&3]+=a)-a+b[--z&3])printf("%lld\n",s+=a);}
// 2016/02/20 02:00 追記
long long a=1,b[9],s; // a以外は0で初期化される
int main(){
int z=1; // 引数argc=1
for(;99+z != 0 ;){
printf("%lld\n",s+=a);
a=(b[z&3]+=a)
-a + b[ (--z) &3];
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment