結果
問題 | No.406 鴨等間隔の法則 |
ユーザー |
|
提出日時 | 2018-03-20 20:06:37 |
言語 | Nim (2.2.0) |
結果 |
RE
|
実行時間 | - |
コード長 | 383 bytes |
コンパイル時間 | 3,288 ms |
コンパイル使用メモリ | 65,868 KB |
実行使用メモリ | 10,112 KB |
最終ジャッジ日時 | 2024-06-30 04:57:56 |
合計ジャッジ時間 | 5,180 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
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()