ACM algorithm code