結果

問題 No.854 公平なりんご分配
ユーザー titia
提出日時 2019-07-26 21:49:06
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 390 bytes
コンパイル時間 84 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 45,964 KB
最終ジャッジ日時 2024-07-02 06:59:21
合計ジャッジ時間 12,837 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 13 WA * 7 RE * 72
権限があれば一括ダウンロードができます

ソースコード

diff #

N=int(input())
A=list(map(int,input().split()))
Q=int(input())
Query=[list(map(int,input().split())) for i in range(Q)]

import math
from itertools import accumulate

B=[math.log(a) for a in A]
S=[0]+list(accumulate(B))

for p,l,r in Query:
    #print(S[r]-S[l-1],round(pow(math.e,S[r]-S[l-1])))
    if round(pow(math.e,S[r]-S[l-1]))%p==0:
        print("Yes")
    else:
        print("NO")
0