Example Input acmicpc tsukuba Output No
- User
Example Input
acmicpc tsukuba
Output
No
Assistant
pythondef is_sorted(s): for i in range(len(s) - 1): if s[i] > s[i+1]: return False return True s = input().strip() t = input().strip() s_sorted = is_sorted(s) t_sorted = is_sorted(t) if not (s_sorted and t_sorted): print("No") else: cond1 = s[-1] <= t[0] cond2 = t[-1] <= s[0] print("Yes" if cond1 or cond2 else "No")
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.