結果
問題 |
No.406 鴨等間隔の法則
|
ユーザー |
|
提出日時 | 2018-03-20 20:08:05 |
言語 | Nim (2.2.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 383 bytes |
コンパイル時間 | 2,982 ms |
コンパイル使用メモリ | 65,664 KB |
実行使用メモリ | 16,256 KB |
最終ジャッジ日時 | 2024-06-30 04:57:51 |
合計ジャッジ時間 | 7,564 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 11 TLE * 1 -- * 17 |
ソースコード
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()