結果

問題 No.406 鴨等間隔の法則
ユーザー nobigomunobigomu
提出日時 2018-04-27 19:33:41
言語 Lua
(LuaJit 2.1.1696795921)
結果
AC  
実行時間 100 ms / 2,000 ms
コード長 324 bytes
コンパイル時間 100 ms
コンパイル使用メモリ 5,212 KB
実行使用メモリ 7,704 KB
最終ジャッジ日時 2023-09-21 18:47:19
合計ジャッジ時間 3,088 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
4,564 KB
testcase_01 AC 1 ms
4,380 KB
testcase_02 AC 1 ms
4,380 KB
testcase_03 AC 1 ms
4,380 KB
testcase_04 AC 91 ms
7,520 KB
testcase_05 AC 30 ms
4,392 KB
testcase_06 AC 32 ms
4,436 KB
testcase_07 AC 32 ms
4,440 KB
testcase_08 AC 87 ms
7,240 KB
testcase_09 AC 94 ms
7,628 KB
testcase_10 AC 36 ms
4,696 KB
testcase_11 AC 72 ms
7,012 KB
testcase_12 AC 46 ms
4,864 KB
testcase_13 AC 42 ms
4,792 KB
testcase_14 AC 76 ms
6,976 KB
testcase_15 AC 4 ms
4,380 KB
testcase_16 AC 6 ms
4,376 KB
testcase_17 AC 4 ms
4,380 KB
testcase_18 AC 7 ms
4,376 KB
testcase_19 AC 8 ms
4,376 KB
testcase_20 AC 10 ms
4,380 KB
testcase_21 AC 11 ms
4,376 KB
testcase_22 AC 19 ms
4,376 KB
testcase_23 AC 48 ms
4,956 KB
testcase_24 AC 67 ms
6,948 KB
testcase_25 AC 95 ms
7,664 KB
testcase_26 AC 96 ms
7,628 KB
testcase_27 AC 67 ms
4,384 KB
testcase_28 AC 100 ms
7,704 KB
testcase_29 AC 96 ms
7,656 KB
testcase_30 AC 93 ms
7,700 KB
testcase_31 AC 90 ms
7,508 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

print((function (f, n)
	local a,t = f()
	if t==0 then return "NO" end
	for i=2,n-1 do if t~=a[i+1]-a[i] then return "NO" end end
	return "YES"
end)(function ()
	local a = {}
	for e in io.stdin:read("*l"):gmatch("%d+") do table.insert(a,tonumber(e)) end
	table.sort(a)
	return a,a[2]-a[1]
end, tonumber(io.stdin:read("*l"))))
0