fork download
  1. typedef unsigned int u32;
  2.  
  3. #define MUL(hi, lo) { \
  4. unsigned long long int a=(unsigned long long int)hi * lo; \
  5. hi = a>>32; lo = a; }
  6.  
  7. int main(){
  8. const int M=17; // wystarczy dla 100!
  9. u32 t[M], p, ax, dx, i, n;
  10. char * w, CY;
  11. n=100; //scanf("%d", %n);
  12. //*************************************
  13. w=(char*)t;
  14. i=M;
  15. do{
  16. *(u32*)w = 0;
  17. w += 4;
  18. i--;
  19. } while (i>0);
  20. t[0]=1;
  21. while( n != 0 ){
  22. i=M;
  23. p=0;
  24. w=(char*)t;
  25. do {
  26. ax = n;
  27. dx = *(u32*)w;
  28. MUL(dx, ax)
  29. ax += p;
  30. CY = (ax<p); // samo się zrobi
  31. dx = dx + 0 + CY;
  32. *(u32*)w = ax;
  33. w += 4;
  34. p=dx;
  35. i--;
  36. } while( i != 0 );
  37. n--; }
  38. //*******************************************************
  39. int k;
  40. for( k=M-1; t[k]==0; k-- ) ;
  41. while( k>=0 )
  42. printf("%08x", t[k--]);
  43. puts("");
  44. puts("00001b30964ec395dc24069528d54bbda40d16e966ef9a70eb21b5b2943a321cdf10391745570cca9420c6ecb3b72ed2ee8b02ea2735c61a000000000000000000000000");}
Runtime error #stdin #stdout 0.01s 1720KB
stdin
Standard input is empty
stdout
00001b30964ec395dc24069528d54bbda40d16e966ef9a70eb21b5b2943a321cdf10391745570cca9420c6ecb3b72ed2ee8b02ea2735c61a000000000000000000000000
00001b30964ec395dc24069528d54bbda40d16e966ef9a70eb21b5b2943a321cdf10391745570cca9420c6ecb3b72ed2ee8b02ea2735c61a000000000000000000000000