結果

問題 No.1584 Stones around Circle Pond
ユーザー googol_S0
提出日時 2021-07-02 22:22:15
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 440 bytes
コンパイル時間 196 ms
コンパイル使用メモリ 82,432 KB
実行使用メモリ 60,928 KB
最終ジャッジ日時 2024-06-29 12:02:39
合計ジャッジ時間 4,812 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 53 WA * 5
権限があれば一括ダウンロードができます

ソースコード

diff #

N,L=map(int,input().split())
D=list(map(int,input().split()))
B=list(map(int,input().split()))
for i in range(N):
  D.append(D[i]+L)
X=[[0]*(N*2) for i in range(N*2)]
for i in range(N*2):
  for j in range(N*2):
    X[i][j]=min((D[i]-D[j])%(2*L),(D[j]-D[i])%(2*L))
U=sum(B)
V=sum(X[0])
if U%V:
  print('No')
  exit()
Z=U//V
for i in range(N*2):
  B[i]-=X[0][i]*Z
if max([B[i]+B[i+N] for i in range(N)])==0:
  print('Yes')
else:
  print('No')
0