結果

問題 No.406 鴨等間隔の法則
ユーザー shimadandyshimadandy
提出日時 2016-09-05 13:24:14
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 123 ms / 2,000 ms
コード長 1,021 bytes
コンパイル時間 2,432 ms
コンパイル使用メモリ 104,800 KB
実行使用メモリ 30,932 KB
最終ジャッジ日時 2023-09-21 18:07:11
合計ジャッジ時間 7,085 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 84 ms
23,220 KB
testcase_01 AC 55 ms
20,824 KB
testcase_02 AC 56 ms
20,784 KB
testcase_03 AC 55 ms
20,744 KB
testcase_04 AC 113 ms
30,532 KB
testcase_05 AC 81 ms
22,892 KB
testcase_06 AC 83 ms
25,160 KB
testcase_07 AC 83 ms
23,032 KB
testcase_08 AC 112 ms
28,392 KB
testcase_09 AC 118 ms
28,792 KB
testcase_10 AC 85 ms
23,320 KB
testcase_11 AC 106 ms
25,856 KB
testcase_12 AC 90 ms
25,788 KB
testcase_13 AC 88 ms
25,808 KB
testcase_14 AC 110 ms
28,228 KB
testcase_15 AC 67 ms
21,320 KB
testcase_16 AC 67 ms
21,396 KB
testcase_17 AC 65 ms
21,304 KB
testcase_18 AC 66 ms
21,532 KB
testcase_19 AC 67 ms
21,640 KB
testcase_20 AC 69 ms
21,764 KB
testcase_21 AC 70 ms
21,864 KB
testcase_22 AC 74 ms
22,564 KB
testcase_23 AC 92 ms
28,036 KB
testcase_24 AC 104 ms
27,744 KB
testcase_25 AC 118 ms
30,932 KB
testcase_26 AC 120 ms
28,928 KB
testcase_27 AC 108 ms
26,824 KB
testcase_28 AC 119 ms
28,892 KB
testcase_29 AC 121 ms
29,136 KB
testcase_30 AC 123 ms
28,840 KB
testcase_31 AC 116 ms
28,664 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;


namespace rummy
{
    class Program
    {
        /// <summary>
        /// プログラムのエントリポイント
        /// </summary>
        /// <param name="args"></param>
        static void Main(string[] args)
        {
            Console.ReadLine();

            string[] tmp = Console.ReadLine().Split(' ');

            List<int> list = new List<int>();
            foreach (string s in tmp)
                list.Add(int.Parse(s));

            list.Sort();

            Console.WriteLine(JudgeInterval(list));
        }

        private static string JudgeInterval(List<int> list)
        {
            for (int i = 0; i < list.Count - 1; i++)
                if (list[i] == list[i + 1])
                    return "NO";

            int interval = list[0] - list[1];
            for (int i = 1; i < list.Count - 1; i++)
                if (list[i] - list[i + 1] != interval)
                    return "NO";

            return "YES";
        }
    }
}
0