結果

問題 No.138 化石のバージョン
ユーザー bluemegane
提出日時 2018-10-23 19:02:37
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 32 ms / 5,000 ms
コード長 881 bytes
コンパイル時間 1,027 ms
コンパイル使用メモリ 113,380 KB
実行使用メモリ 29,220 KB
最終ジャッジ日時 2024-11-19 04:33:40
合計ジャッジ時間 3,152 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
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.Linq;
using System.Collections.Generic;
using System;

public class P
{
    public int id { get; set; }
    public int a { get; set; }
    public int b { get; set; }
    public int c { get; set; }
}

public class Hello
{
    public static void Main()
    {
        var ps = new List<P>();
        for (int i = 0; i < 2; i++)
        {
            string[] line = Console.ReadLine().Trim().Split('.');
            var a = int.Parse(line[0]);
            var b = int.Parse(line[1]);
            var c = int.Parse(line[2]);
            ps.Add(new P { a = a, b = b, c = c ,id = i});
        }
        if (ps[0].a == ps[1].a && ps[0].b== ps[1].b && ps[0].c == ps[1].c)
        { Console.WriteLine("YES"); goto exit; }
        var id = ps.OrderBy(x => x.a).ThenBy(x => x.b).ThenBy(x => x.c).First().id;
        Console.WriteLine(id == 0? "NO":"YES");
        exit:;
    }
}
0