some exercise of acm problem