結果
| 問題 |
No.1884 Sequence
|
| コンテスト | |
| ユーザー |
k_o_pasture
|
| 提出日時 | 2022-03-25 21:47:16 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 428 bytes |
| コンパイル時間 | 108 ms |
| コンパイル使用メモリ | 12,672 KB |
| 実行使用メモリ | 34,404 KB |
| 最終ジャッジ日時 | 2024-10-14 05:43:14 |
| 合計ジャッジ時間 | 8,688 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 26 WA * 14 |
ソースコード
from math import *
N = int(input())
A = sorted(list(map(int, input().split())))
c = 0 # 0 の数
B = []
for a in A:
if a == 0:
c += 1
else:
B.append(a)
# print('c',c)
# print('B',B)
D = [] # 差
for i in range(1,len(B)):
D.append(B[i]-B[i-1])
# print(D)
if len(D) == len([d for d in D if d == 0]):
print('Yes')
exit()
G = gcd(*D) # 差の最大公約数
M = max(D) // G
if c >= M:
print('Yes')
else:
print('No')
k_o_pasture