結果
問題 | No.138 化石のバージョン |
ユーザー |
![]() |
提出日時 | 2017-04-29 17:43:05 |
言語 | Java (openjdk 23) |
結果 |
AC
|
実行時間 | 76 ms / 5,000 ms |
コード長 | 1,071 bytes |
コンパイル時間 | 2,506 ms |
コンパイル使用メモリ | 80,512 KB |
実行使用メモリ | 53,076 KB |
最終ジャッジ日時 | 2024-12-29 14:21:53 |
合計ジャッジ時間 | 6,244 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 33 |
ソースコード
import java.io.BufferedReader;import java.io.IOException;import java.io.InputStreamReader;import java.util.Arrays;import java.util.stream.Stream;import static java.lang.System.in;public class Main {public static void main(String[] args) throws IOException {BufferedReader reader = new BufferedReader(new InputStreamReader(in));String[] S = reader.readLine().split("\\.");String[] M = reader.readLine().split("\\.");int[] possibleOldVersion = Stream.of(S).mapToInt(Integer::parseInt).toArray();int[] targetVersion = Stream.of(M).mapToInt(Integer::parseInt).toArray();for (int i = 0; i < 3; i++) {if (possibleOldVersion[i] < targetVersion[i]) {System.out.println("NO");break;} else if (possibleOldVersion[i] == targetVersion[i]) {if (i==2) {System.out.println("YES");}} else {System.out.println("YES");break;}}}}