No.138 Fossil Version
タグ : / 解いたユーザー数 677
作問者 :
Problem Statement
Apparently, gcc $4.8.1$ is widely said to be a fossil.
You are given the version said to be a fossil as a string in the specific format $A.B.C$ (where $A,B,C$ are each integers between $0$ and $100$, inclusive). Determine whether a version given in the same format is a fossil.
Print "$YES$" if it is a fossil version, and "$NO$" if it is not a fossil version.
A fossil version is one that is the same as the specified version or older than it.
Whether a version is older is determined by whether the numbers separated by "$.$" are smaller, with numbers written further to the left taking priority.
For example, $4.7.9$ is older than $4.8.1$, and $4.9.0$ and $5.0.1$ are newer than $4.8.1$.
Input
$A_0.B_0.C_0$ $A_1.B_1.C_1$
All input values are integers. Note that they are separated by $.$
The first line gives the version said to be a fossil.
The second line gives the version to be judged.
$0\le i \le 1$
$0\le A_i \le 100$
$0\le B_i \le 100$
$0\le C_i \le 100$
Output
Print "$YES$" if it is a fossil version, and "$NO$" if it is not a fossil version.
Print a newline at the end.
Sample
Sample 1
Input
4.8.1 4.8.0
Output
YES
If $4.8.1$ is a fossil version, then the older $4.8.0$ is also a fossil version.
Sample 2
Input
0.0.0 1.1.1
Output
NO
It seems only the initial version is called a fossil.
Sample 3
Input
1.2.3 3.2.1
Output
NO
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。