結果

問題 No.632 穴埋め門松列
ユーザー CroweaCrowea
提出日時 2019-01-23 23:23:38
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 77 ms / 1,000 ms
コード長 781 bytes
コンパイル時間 1,753 ms
コンパイル使用メモリ 63,592 KB
実行使用メモリ 24,168 KB
最終ジャッジ日時 2023-10-14 09:32:33
合計ジャッジ時間 2,573 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 76 ms
21,980 KB
testcase_01 AC 77 ms
22,000 KB
testcase_02 AC 77 ms
24,168 KB
testcase_03 AC 76 ms
22,212 KB
testcase_04 AC 76 ms
22,096 KB
testcase_05 AC 77 ms
22,100 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

using System;
using System.Linq;

class Program
{
    static void Main(string[] args)
    {
        var line = Console.ReadLine().Split(' ');
        int idx = 0;
        for (int i = 0; i < line.Length; i++)
        {
            if (line[i] == "?")
            {
                idx = i;
                break;
            }
        }

        string result = string.Empty;
        line[idx] = "1";
        result = (line.Min().CompareTo(line[1]) == 0 || line.Max().CompareTo(line[1]) == 0) ? "1" : "4";

        if (result == "1")
        {
            line[idx] = "4";
            result = (line.Min().CompareTo(line[1]) == 0 || line.Max().CompareTo(line[1]) == 0) ? "14" : "1";
            Console.WriteLine(result);
        }
        else Console.WriteLine(result);
    }
}

0