結果

問題 No.406 鴨等間隔の法則
ユーザー claw88claw88
提出日時 2016-08-05 22:51:18
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 127 ms / 2,000 ms
コード長 993 bytes
コンパイル時間 2,096 ms
コンパイル使用メモリ 103,056 KB
実行使用メモリ 29,404 KB
最終ジャッジ日時 2023-09-21 17:46:55
合計ジャッジ時間 6,598 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 88 ms
22,948 KB
testcase_01 AC 58 ms
20,716 KB
testcase_02 AC 59 ms
22,708 KB
testcase_03 AC 59 ms
22,784 KB
testcase_04 AC 118 ms
27,708 KB
testcase_05 AC 85 ms
22,716 KB
testcase_06 AC 88 ms
24,912 KB
testcase_07 AC 87 ms
22,764 KB
testcase_08 AC 118 ms
25,652 KB
testcase_09 AC 124 ms
28,200 KB
testcase_10 AC 90 ms
24,896 KB
testcase_11 AC 112 ms
27,116 KB
testcase_12 AC 94 ms
23,316 KB
testcase_13 AC 92 ms
23,588 KB
testcase_14 AC 115 ms
29,404 KB
testcase_15 AC 68 ms
21,460 KB
testcase_16 AC 70 ms
21,340 KB
testcase_17 AC 68 ms
21,208 KB
testcase_18 AC 70 ms
21,432 KB
testcase_19 AC 71 ms
23,540 KB
testcase_20 AC 73 ms
23,876 KB
testcase_21 AC 73 ms
21,592 KB
testcase_22 AC 79 ms
22,272 KB
testcase_23 AC 99 ms
27,880 KB
testcase_24 AC 110 ms
26,964 KB
testcase_25 AC 124 ms
28,332 KB
testcase_26 AC 127 ms
28,240 KB
testcase_27 AC 113 ms
28,184 KB
testcase_28 AC 119 ms
28,236 KB
testcase_29 AC 124 ms
28,316 KB
testcase_30 AC 124 ms
28,144 KB
testcase_31 AC 122 ms
27,964 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 yuki_406
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.ReadLine();
            var x = scan();
            Array.Sort(x);
            bool z = false;
            int k = x[1] - x[0];
            if (k==0)
            {
                z = true;
            }
            for (int i = 2; i < x.Length; i++)
            {
                if (x[i]-x[i-1]!=k)
                {
                    z = true;
                    break;
                }
            }
            if (z)
            {
                Console.WriteLine("NO");
            }
            else
            {
                Console.WriteLine("YES");
            }
        }
        static int[] scan()
        {
            return
                Array.ConvertAll
                (Console.ReadLine().Split(' '), int.Parse);
        }
    }
}
0