結果

問題 No.138 化石のバージョン
コンテスト
ユーザー 大谷祐翔
提出日時 2025-11-11 15:02:07
言語 C#
(.NET 8.0.404)
結果
AC  
実行時間 88 ms / 5,000 ms
コード長 1,140 bytes
コンパイル時間 19,648 ms
コンパイル使用メモリ 169,404 KB
実行使用メモリ 186,304 KB
最終ジャッジ日時 2025-11-11 15:02:38
合計ジャッジ時間 11,694 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 33
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.csproj を復元しました (176 ミリ秒)。
  main -> /home/judge/data/code/bin/Release/net8.0/main.dll
  main -> /home/judge/data/code/bin/Release/net8.0/publish/

ソースコード

diff #

class Program
{
    static void Main(string[] args)
    {
        string inputTop = Console.ReadLine()!;
        string inputBottom = Console.ReadLine()!;
        List<int> oldList = new List<int>();
        List<int> myList = new List<int>();

        NumChangeFunc(inputTop, oldList);
        NumChangeFunc(inputBottom, myList);

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

    public static void NumChangeFunc(string input, List<int> versionList)
    {
        string version = "";
        foreach (char c in input)
        {
            if (c == '.')
            {
                versionList.Add(int.Parse(version));
                version = "";
            }
            else
            {
                version += c;
            }
        }
        versionList.Add(int.Parse(version));
    }
}
0