結果

問題 No.632 穴埋め門松列
ユーザー poritporit
提出日時 2018-01-20 00:15:27
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 72 ms / 1,000 ms
コード長 1,341 bytes
コンパイル時間 2,019 ms
コンパイル使用メモリ 101,952 KB
実行使用メモリ 23,396 KB
最終ジャッジ日時 2023-08-26 00:35:17
合計ジャッジ時間 3,132 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 69 ms
21,324 KB
testcase_01 AC 70 ms
21,344 KB
testcase_02 AC 69 ms
21,340 KB
testcase_03 AC 70 ms
23,308 KB
testcase_04 AC 71 ms
23,396 KB
testcase_05 AC 72 ms
21,508 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 Program
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] list = Console.ReadLine().Split();
            string output = null;

            //?=1の場合
            for (int i = 0; i < 3; ++i)
            {
                if (String.Compare(list[i], "?", true) == 0)
                {
                    list[i] = "1";
                }
            }

            int x1 = int.Parse(list[0]);
            int x2 = int.Parse(list[1]);
            int x3 = int.Parse(list[2]);

            if ((x2 > x1 && x2 > x3) || (x2 < x1 && x2 < x3))
            {
                output += "1";
            }


            //?=4の場合
            for (int i = 0; i < 3; ++i)
            {
                if (String.Compare(list[i], "1", true) == 0)
                {
                    list[i] = "4";
                }
            }

            int x4 = int.Parse(list[0]);
            int x5 = int.Parse(list[1]);
            int x6 = int.Parse(list[2]);

            if ((x5 > x4 && x5 > x6) || (x5 < x4 && x5 < x6))
            {
                output += "4";
            }


            Console.WriteLine(output);
            Console.ReadLine();
        }
    }
}
0