I ocassional deal with cramping, I just did a 200 mile race without any cramping.
I pre-race hydrate 2-3 days before the race, just chugging lots of water throught the day.
Second, I take magnesium and potassium pills starting at least a week prior to the race...one each in the morning and same...