Hello everybody,
I am new to SPOJ so I picked a problem I think I am good at to start, FCTRL, as I had solved this problem in paper before. I didn't find an easy way to replace printf though, so I am still using it. Not sure is it costing most of time.
From there, I am stuck for two days there.
My first try used 2 seconds. Thanks to this post here, using getchar_unlocked reduced it to 0.08 but it's still 4 times the best solution. From there, I tried different ways but can't improve.
My algorithm includes 14 times loop for 1000000000, which is the best I can think of now. Each look includes an addition and divided by 5. I think the division caused most of the time but after I changed it to this operation, it back to 0.10.
Can anybody point out which way should I go now?
Thanks.