結果

問題 No.138 化石のバージョン
ユーザー NoNo
提出日時 2015-04-20 19:02:51
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 1,624 bytes
コンパイル時間 2,761 ms
コンパイル使用メモリ 102,616 KB
実行使用メモリ 24,000 KB
最終ジャッジ日時 2023-09-18 01:42:11
合計ジャッジ時間 6,761 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 58 ms
21,936 KB
testcase_01 AC 58 ms
21,808 KB
testcase_02 AC 58 ms
21,864 KB
testcase_03 AC 59 ms
21,932 KB
testcase_04 AC 59 ms
23,872 KB
testcase_05 AC 59 ms
23,856 KB
testcase_06 AC 59 ms
21,904 KB
testcase_07 AC 60 ms
23,900 KB
testcase_08 AC 59 ms
21,752 KB
testcase_09 AC 58 ms
22,004 KB
testcase_10 AC 59 ms
23,784 KB
testcase_11 AC 59 ms
21,828 KB
testcase_12 AC 59 ms
21,944 KB
testcase_13 AC 59 ms
19,764 KB
testcase_14 AC 59 ms
21,828 KB
testcase_15 AC 57 ms
21,812 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 59 ms
23,952 KB
testcase_20 AC 59 ms
21,736 KB
testcase_21 WA -
testcase_22 AC 61 ms
21,748 KB
testcase_23 AC 60 ms
23,796 KB
testcase_24 AC 58 ms
21,868 KB
testcase_25 AC 59 ms
21,956 KB
testcase_26 AC 59 ms
24,000 KB
testcase_27 AC 59 ms
21,828 KB
testcase_28 AC 60 ms
23,796 KB
testcase_29 AC 59 ms
23,800 KB
testcase_30 AC 58 ms
23,972 KB
testcase_31 AC 57 ms
19,864 KB
testcase_32 AC 58 ms
21,836 KB
testcase_33 AC 58 ms
19,704 KB
testcase_34 AC 58 ms
23,820 KB
testcase_35 AC 59 ms
21,752 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
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 ForYukicoder
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] oldVer = Console.ReadLine().Split('.').Select(int.Parse).ToArray();
            int[] ver = Console.ReadLine().Split('.').Select(int.Parse).ToArray();
            bool isOld = true;

            if (oldVer[0] == ver[0])
            {
                if (oldVer[1] == ver[1])
                {
                    if (oldVer[2] == ver[2])
                    {
                        //同バージョン;
                        isOld = false;
                    }
                    else if (oldVer[2] - ver[2] > 0)
                    {
                        //化石
                        isOld = true;
                    }
                    else
                    {
                        //化石じゃない
                        isOld = false;
                    }
                }
                else if (oldVer[1] - ver[1] > 0)
                {
                    //化石
                    isOld = true;
                }
                else
                {
                    //化石じゃない
                    isOld = false;
                } 
            }else if(oldVer[0] - ver[0] > 0 ){
                //化石
                isOld = true;
            }
            else
            {
                //化石じゃない
                isOld = false;
            }

            Console.WriteLine((isOld) ? "YES" : "NO");
        }
    }
}
0