1#include <stdint.h> 2#include <stdlib.h> 3 4static uint64_t seed; 5 6void srand(unsigned s) { 7 seed = s - 1; 8} 9 10int rand(void) { 11 seed = 6364136223846793005ULL * seed + 1; 12 return seed >> 33; 13} 14