問題一覧 > 通常問題

No.138 Fossil Version

レベル : / AI推定難易度 : 130 / 実行時間制限 : 1ケース 5.000秒 / メモリ制限 : 512 MB / 標準ジャッジ問題
タグ : (AC するまで非表示) / 解いたユーザー数 677
作問者 : yuki2006
お気に入りにしたユーザー ProblemId : 341 / 自分の提出
問題文最終更新日: 2026-06-25 12:51:13
This statement was translated by AI (claude-opus-5-5, effort medium) and may contain errors or differ in nuance from the original. The original statement takes precedence. Back to the original
yukicoder contest 81 (順位表) の他の問題:

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もしくは右上の雲マークをクリックしてアカウントを作成してください。