結果

問題 No.854 公平なりんご分配
ユーザー aaaaaaaaaa2230aaaaaaaaaa2230
提出日時 2022-05-20 12:42:29
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 742 bytes
コンパイル時間 222 ms
コンパイル使用メモリ 81,760 KB
実行使用メモリ 82,044 KB
最終ジャッジ日時 2023-10-20 00:37:54
合計ジャッジ時間 19,661 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 41 ms
59,488 KB
testcase_01 AC 43 ms
62,044 KB
testcase_02 AC 46 ms
62,140 KB
testcase_03 AC 45 ms
61,956 KB
testcase_04 AC 43 ms
62,116 KB
testcase_05 AC 45 ms
61,956 KB
testcase_06 AC 45 ms
62,320 KB
testcase_07 AC 48 ms
62,040 KB
testcase_08 AC 46 ms
61,956 KB
testcase_09 AC 45 ms
61,956 KB
testcase_10 AC 46 ms
62,200 KB
testcase_11 AC 46 ms
61,956 KB
testcase_12 AC 50 ms
64,372 KB
testcase_13 AC 48 ms
64,372 KB
testcase_14 AC 44 ms
61,556 KB
testcase_15 AC 46 ms
62,200 KB
testcase_16 AC 53 ms
64,372 KB
testcase_17 AC 48 ms
62,232 KB
testcase_18 AC 46 ms
62,200 KB
testcase_19 AC 47 ms
62,232 KB
testcase_20 AC 45 ms
62,256 KB
testcase_21 AC 46 ms
62,200 KB
testcase_22 AC 73 ms
70,688 KB
testcase_23 AC 62 ms
66,500 KB
testcase_24 AC 87 ms
72,740 KB
testcase_25 AC 60 ms
66,484 KB
testcase_26 AC 81 ms
72,740 KB
testcase_27 AC 73 ms
68,560 KB
testcase_28 AC 71 ms
70,664 KB
testcase_29 AC 58 ms
66,516 KB
testcase_30 AC 62 ms
66,484 KB
testcase_31 AC 84 ms
72,744 KB
testcase_32 AC 256 ms
78,212 KB
testcase_33 AC 334 ms
77,948 KB
testcase_34 AC 567 ms
79,028 KB
testcase_35 AC 400 ms
78,288 KB
testcase_36 AC 251 ms
78,152 KB
testcase_37 AC 260 ms
78,200 KB
testcase_38 AC 209 ms
77,544 KB
testcase_39 AC 624 ms
81,776 KB
testcase_40 AC 353 ms
78,164 KB
testcase_41 AC 329 ms
78,184 KB
testcase_42 AC 505 ms
78,768 KB
testcase_43 AC 465 ms
80,032 KB
testcase_44 AC 505 ms
79,272 KB
testcase_45 AC 507 ms
82,044 KB
testcase_46 AC 654 ms
81,440 KB
testcase_47 AC 295 ms
77,900 KB
testcase_48 AC 478 ms
78,652 KB
testcase_49 AC 375 ms
78,728 KB
testcase_50 AC 307 ms
77,984 KB
testcase_51 AC 510 ms
81,392 KB
testcase_52 TLE -
testcase_53 -- -
testcase_54 -- -
testcase_55 -- -
testcase_56 -- -
testcase_57 -- -
testcase_58 -- -
testcase_59 -- -
testcase_60 -- -
testcase_61 -- -
testcase_62 -- -
testcase_63 -- -
testcase_64 -- -
testcase_65 -- -
testcase_66 -- -
testcase_67 -- -
testcase_68 -- -
testcase_69 -- -
testcase_70 -- -
testcase_71 -- -
testcase_72 -- -
testcase_73 -- -
testcase_74 -- -
testcase_75 -- -
testcase_76 -- -
testcase_77 -- -
testcase_78 -- -
testcase_79 -- -
testcase_80 -- -
testcase_81 -- -
testcase_82 -- -
testcase_83 -- -
testcase_84 -- -
testcase_85 -- -
testcase_86 -- -
testcase_87 -- -
testcase_88 -- -
testcase_89 -- -
testcase_90 -- -
testcase_91 -- -
testcase_92 -- -
testcase_93 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
A = list(map(int,input().split()))
q = int(input())
P = []
LR = []
for i in range(q):
    p,l,r = map(int,input().split())
    P.append(p)
    LR.append([l-1,r])


M = 2*10**3+5
count = [0]*M
primes = []
for i in range(2,M):
    if count[i]:
        continue
    primes.append(i)
    for j in range(i,M,i):
        count[j] += 1

accum = [0]*(n+1)
for p in primes:
    for i,a in enumerate(A,1):
        c = 0
        na = a
        while na%p == 0:
            na //= p
            c += 1
        accum[i] = accum[i-1]+c

    for i in range(q):
        l,r = LR[i]
        num = accum[r]-accum[l]
        while num and P[i]%p == 0:
            P[i] //= p
            num -= 1
for p in P:
    print("Yes" if p == 1 else "NO")
0