結果

問題 No.138 化石のバージョン
ユーザー ccc
提出日時 2022-09-01 11:59:08
言語 C#
(.NET 8.0.404)
結果
AC  
実行時間 57 ms / 5,000 ms
コード長 1,015 bytes
コンパイル時間 7,764 ms
コンパイル使用メモリ 168,572 KB
実行使用メモリ 186,464 KB
最終ジャッジ日時 2024-11-14 03:16:44
合計ジャッジ時間 11,121 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 33
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.csproj を復元しました (94 ms)。
MSBuild のバージョン 17.9.6+a4ecab324 (.NET)
  main -> /home/judge/data/code/bin/Release/net8.0/main.dll
  main -> /home/judge/data/code/bin/Release/net8.0/publish/

ソースコード

diff #

using System;
using System.Linq;
using System.Collections.Generic;
using System.Text.RegularExpressions;


class Program
{
    static void Main()
    {
        var ver1 = Console.ReadLine().Split(".").Select(int.Parse).ToArray();
        var ver2 = Console.ReadLine().Split(".").Select(int.Parse).ToArray();

        var Program = new Program();
        bool isEqual = ver1.SequenceEqual(ver2);
        if (isEqual) Console.WriteLine("YES");

        for (int i = 0; i < ver1.Length; i++)
        {
        
            if (ver1[i] == ver2[i])
            {
                continue;
            }
            else
            {
                Program.CheckNum(ver1[i], ver2[i]);
                break;
            }
        }
    }
    public void CheckNum(int x, int y)
    {
        if ( x > y)
        {
            Console.WriteLine("YES");
        }
        else if(x < y)
        {
            Console.WriteLine("NO");
        }
        else
        {
            Console.WriteLine("YES");
        }
    }
}
0