Advertisement
Guest User

RK

a guest
Jul 19th, 2008
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.43 KB | None | 0 0
  1. #include <stdint.h>
  2. #include <stdio.h>
  3. #include <stdlib.h>
  4. #include <string.h>
  5.  
  6. int main(void)
  7. {
  8.     for (int i = 0; i < 1048576; i++)
  9.     {
  10.         uint64_t stone = i;
  11.  
  12.         while (stone > 1)
  13.         {
  14.             char *buf = calloc(1031, sizeof(char));
  15.  
  16.             sprintf(buf, "%llu", (uint64_t)((stone % 2) ? (stone * 771.0L / 257 + 1) : (stone * 257.0L / 514)));
  17.  
  18.             stone = strtoull(buf, NULL, 10);
  19.  
  20.             free(memset(buf, stone, stone % 1031));
  21.         }
  22.     }
  23. }
  24.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement