結果
問題 | No.1884 Sequence |
ユーザー |
![]() |
提出日時 | 2023-01-01 14:43:17 |
言語 | PyPy3 (7.3.15) |
結果 |
RE
|
実行時間 | - |
コード長 | 584 bytes |
コンパイル時間 | 239 ms |
コンパイル使用メモリ | 81,976 KB |
実行使用メモリ | 163,116 KB |
最終ジャッジ日時 | 2024-11-27 00:04:45 |
合計ジャッジ時間 | 6,757 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 36 WA * 2 RE * 2 |
ソースコード
N = int(input())A = list(map(int, input().split()))L = []zero = 0for a in A:if a == 0:zero += 1else:L.append(a)L.sort()if len(set(L)) == 1:print("Yes")exit()D = []for i in range(len(L) - 1):D.append(L[i + 1] - L[i])minv = min(D)if minv == 0:print("No")exit()cnt = 0for d in D:cnt += d - 1if cnt <= zero:print("Yes")exit()cnt = 0for d in D:if d % minv != 0:print("No")exit()cnt += d // minv - 1if cnt <= zero:print("Yes")else:print("No")