PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN
#SCKT0000002. Ba chữ số tăng dần (Increasing Digits)
Bài tập này chưa được xếp vào lộ trình.
Mục lục đề ⌄
Đang đọc
Ba chữ số tăng dần (Increasing Digits)
Increasing Digits
Version: Phuoc Hung OJ Extended
Problem Statement
You are given a positive three-digit integer .
Let , , and be the hundreds digit, tens digit, and units digit of , respectively. Then
where and .
The digits of are strictly increasing if every digit is greater than the digit immediately before it, that is,
Determine whether the three digits of are strictly increasing.
Input
One line containing the integer .
Output
Print YES if the three digits of are strictly increasing.
Otherwise, print NO.
Subtasks
- Subtask 1 (20%): and the hundreds digit is smaller than the tens digit.
- Subtask 2 (30%): and the three digits of are pairwise distinct.
- Subtask 3 (50%): , with no additional condition.
Examples
Input
479
Output
YES
Explanation
The digits of are , , and .
Since , the digits are strictly increasing, so the answer is YES.
Liên quan
Trong các cuộc thi sau: