結果

問題 No.138 化石のバージョン
ユーザー ooh_20
提出日時 2018-01-18 14:46:16
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 26 ms / 5,000 ms
コード長 1,064 bytes
コンパイル時間 1,006 ms
コンパイル使用メモリ 103,808 KB
実行使用メモリ 17,920 KB
最終ジャッジ日時 2024-12-29 14:43:57
合計ジャッジ時間 3,032 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 33
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp28
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] row = Console.ReadLine().Split('.');
            int[] fossil = new int[3];
            for (int i = 0; i < 3; i++)
            {
                fossil[i] = int.Parse(row[i]);
            }

            row = Console.ReadLine().Split('.');
            int[] judge = new int[3];
            for (int i = 0; i < 3; i++)
            {
                judge[i] = int.Parse(row[i]);
            }

            for (int i = 0; i < 3; i++)
            {
                if (fossil[i] > judge[i])
                {
                    Console.WriteLine("YES");
                    return;
                }
                else if (fossil[i] < judge[i])
                {
                    Console.WriteLine("NO");
                    return;
                }
            }

            Console.WriteLine("YES");
        }
    }
}
0