結果

問題 No.406 鴨等間隔の法則
ユーザー ixTL255ixTL255
提出日時 2016-08-06 14:50:33
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 127 ms / 2,000 ms
コード長 574 bytes
コンパイル時間 3,086 ms
コンパイル使用メモリ 104,180 KB
実行使用メモリ 32,184 KB
最終ジャッジ日時 2023-09-21 17:53:23
合計ジャッジ時間 7,016 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 90 ms
24,164 KB
testcase_01 AC 59 ms
23,628 KB
testcase_02 AC 58 ms
19,592 KB
testcase_03 AC 60 ms
23,680 KB
testcase_04 AC 121 ms
31,908 KB
testcase_05 AC 88 ms
23,888 KB
testcase_06 AC 88 ms
24,012 KB
testcase_07 AC 89 ms
26,052 KB
testcase_08 AC 119 ms
29,628 KB
testcase_09 AC 125 ms
32,184 KB
testcase_10 AC 90 ms
24,340 KB
testcase_11 AC 111 ms
26,916 KB
testcase_12 AC 97 ms
26,676 KB
testcase_13 AC 93 ms
24,752 KB
testcase_14 AC 118 ms
31,308 KB
testcase_15 AC 69 ms
22,176 KB
testcase_16 AC 71 ms
22,272 KB
testcase_17 AC 69 ms
24,040 KB
testcase_18 AC 71 ms
22,296 KB
testcase_19 AC 72 ms
22,420 KB
testcase_20 AC 73 ms
22,672 KB
testcase_21 AC 74 ms
22,656 KB
testcase_22 AC 81 ms
23,400 KB
testcase_23 AC 98 ms
28,892 KB
testcase_24 AC 111 ms
28,876 KB
testcase_25 AC 125 ms
30,068 KB
testcase_26 AC 127 ms
30,252 KB
testcase_27 AC 117 ms
30,172 KB
testcase_28 AC 120 ms
30,124 KB
testcase_29 AC 127 ms
32,176 KB
testcase_30 AC 125 ms
30,040 KB
testcase_31 AC 123 ms
29,860 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;

public class Test
{
	public static void Main()
	{
		var N = int.Parse(Console.ReadLine());
		var x = Console.ReadLine()
				.Split(' ')
				.Select(n => int.Parse(n))
				.ToList();
		x.Sort();
		var d = new List<int>();
		
		for(int i = 0; i < x.Count - 1; i++) d.Add(x[i + 1] - x[i]);
		string ans = "YES";
		for(int j = 0; j < d.Count; j++)
		{
			if(d[0] == 0)
			{
				ans = "NO";
				break;
			}
			if(d[j] != d[0] || d[j] == 0)
			{
				ans = "NO";
				break;
			}
		}
		Console.WriteLine(ans);
	}
}
0