結果
問題 |
No.406 鴨等間隔の法則
|
ユーザー |
|
提出日時 | 2018-03-20 19:57:20 |
言語 | Nim (2.2.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 419 bytes |
コンパイル時間 | 3,316 ms |
コンパイル使用メモリ | 65,700 KB |
実行使用メモリ | 13,888 KB |
最終ジャッジ日時 | 2024-06-30 04:57:16 |
合計ジャッジ時間 | 8,366 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 1 TLE * 1 -- * 27 |
ソースコード
import sequtils, strutils, algorithm var n = readLine(stdin).parseInt x = readLine(stdin).split.map(parseInt) sort(x, cmp[int]) proc main():string = if len(x) != len(deduplicate(x)): return "NO" var m = x[1] - x[0] for i,v in x: if i <= 1: continue if v - x[i - 1] == m: continue else: return "NO" return "YES" echo main()