結果
| 問題 | No.406 鴨等間隔の法則 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2018-03-20 20:06:37 |
| 言語 | Nim (2.2.8) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 383 bytes |
| 記録 | |
| コンパイル時間 | 2,630 ms |
| コンパイル使用メモリ | 69,248 KB |
| 実行使用メモリ | 10,880 KB |
| 最終ジャッジ日時 | 2026-03-19 23:10:22 |
| 合計ジャッジ時間 | 4,079 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 RE * 2 |
| other | AC * 19 RE * 10 |
ソースコード
import sequtils, strutils, algorithm
var
n = readLine(stdin).parseInt
x = readLine(stdin).split.map(parseInt)
sort(x, cmp[int])
proc main():string =
var m = x[1] - x[0]
for i in 1..n:
if x[i] - x[i - 1] == m:
continue
else:
return "NO"
if len(x) != len(deduplicate(x)):
return "NO"
return "YES"
echo main()