#PCBTAM0000009. So sánh chuỗi theo thứ tự từ điển (Lexicographic String Comparison)
So sánh chuỗi theo thứ tự từ điển (Lexicographic String Comparison)
Lexicographic String Comparison
Version: Phuoc Hung OJ Extended
Problem Statement
Given two strings and , compare them using Python 3 lexicographic order. Scan from left to right; at the first differing position, the string with the smaller Unicode code point comes first. If the common prefix is identical, the shorter string comes first. Identical strings are equal.
Report whether , , and , in that order. Comparisons are case-sensitive and preserve Vietnamese characters.
Input
The first line contains ; the second contains . Either string may be empty.
Output
Print three lines corresponding to , , and . Each line is exactly True or False.
Subtasks
- Subtask 1 (100 points): Unicode characters.
Examples
Example 1
Input
An
Binh
Output
True
False
False
Explanation. At the first position, A precedes B, so only is True.
Example 2
Input
A
A
Output
False
True
False
Explanation. Both strings equal A, so only equality evaluates to True.
Example 3
Input
abc
ab
Output
False
False
True
Explanation. ab is a prefix of abc; the longer string follows it, so .