Example Input ACM Output 0
- User
Example Input
ACM
Output
0
Assistant
s = input().strip() if not s: print(0) else: chars = sorted(ord(c) for c in s) n = len(chars) if n % 2 == 1: median = chars[n // 2] total = sum(abs(c - median) for c in chars) else: m1 = chars[(n // 2) - 1] m2 = chars[n // 2] total1 = sum(abs(c - m1) for c in chars) total2 = sum(abs(c - m2) for c in chars) total = min(total1, total2) print(total)
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.