結果
問題 | No.854 公平なりんご分配 |
ユーザー | convexineq |
提出日時 | 2021-03-26 05:30:53 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,144 bytes |
コンパイル時間 | 1,065 ms |
コンパイル使用メモリ | 86,708 KB |
実行使用メモリ | 321,244 KB |
最終ジャッジ日時 | 2023-08-18 10:42:08 |
合計ジャッジ時間 | 61,219 ms |
ジャッジサーバーID (参考情報) |
judge14 / judge11 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 91 ms
76,528 KB |
testcase_01 | AC | 94 ms
76,968 KB |
testcase_02 | AC | 91 ms
76,492 KB |
testcase_03 | AC | 92 ms
77,032 KB |
testcase_04 | AC | 91 ms
76,624 KB |
testcase_05 | AC | 94 ms
76,484 KB |
testcase_06 | AC | 93 ms
76,876 KB |
testcase_07 | AC | 95 ms
77,048 KB |
testcase_08 | AC | 92 ms
76,740 KB |
testcase_09 | AC | 92 ms
76,876 KB |
testcase_10 | AC | 92 ms
76,888 KB |
testcase_11 | AC | 93 ms
76,656 KB |
testcase_12 | AC | 96 ms
77,140 KB |
testcase_13 | AC | 95 ms
76,928 KB |
testcase_14 | AC | 91 ms
76,492 KB |
testcase_15 | AC | 93 ms
77,036 KB |
testcase_16 | AC | 96 ms
76,964 KB |
testcase_17 | AC | 97 ms
77,076 KB |
testcase_18 | AC | 93 ms
76,888 KB |
testcase_19 | AC | 95 ms
77,092 KB |
testcase_20 | AC | 93 ms
77,316 KB |
testcase_21 | AC | 94 ms
76,888 KB |
testcase_22 | WA | - |
testcase_23 | WA | - |
testcase_24 | WA | - |
testcase_25 | WA | - |
testcase_26 | WA | - |
testcase_27 | WA | - |
testcase_28 | WA | - |
testcase_29 | WA | - |
testcase_30 | WA | - |
testcase_31 | WA | - |
testcase_32 | WA | - |
testcase_33 | WA | - |
testcase_34 | WA | - |
testcase_35 | WA | - |
testcase_36 | WA | - |
testcase_37 | WA | - |
testcase_38 | WA | - |
testcase_39 | WA | - |
testcase_40 | WA | - |
testcase_41 | WA | - |
testcase_42 | WA | - |
testcase_43 | WA | - |
testcase_44 | WA | - |
testcase_45 | WA | - |
testcase_46 | WA | - |
testcase_47 | WA | - |
testcase_48 | WA | - |
testcase_49 | WA | - |
testcase_50 | WA | - |
testcase_51 | WA | - |
testcase_52 | WA | - |
testcase_53 | WA | - |
testcase_54 | WA | - |
testcase_55 | WA | - |
testcase_56 | WA | - |
testcase_57 | WA | - |
testcase_58 | WA | - |
testcase_59 | WA | - |
testcase_60 | WA | - |
testcase_61 | WA | - |
testcase_62 | WA | - |
testcase_63 | WA | - |
testcase_64 | WA | - |
testcase_65 | WA | - |
testcase_66 | WA | - |
testcase_67 | WA | - |
testcase_68 | WA | - |
testcase_69 | WA | - |
testcase_70 | WA | - |
testcase_71 | WA | - |
testcase_72 | WA | - |
testcase_73 | WA | - |
testcase_74 | WA | - |
testcase_75 | WA | - |
testcase_76 | WA | - |
testcase_77 | WA | - |
testcase_78 | WA | - |
testcase_79 | WA | - |
testcase_80 | WA | - |
testcase_81 | WA | - |
testcase_82 | MLE | - |
testcase_83 | MLE | - |
testcase_84 | MLE | - |
testcase_85 | MLE | - |
testcase_86 | MLE | - |
testcase_87 | MLE | - |
testcase_88 | TLE | - |
testcase_89 | TLE | - |
testcase_90 | TLE | - |
testcase_91 | TLE | - |
testcase_92 | TLE | - |
testcase_93 | MLE | - |
ソースコード
def Eratosthenes(N): #N以下の素数のリストを返す N+=1 is_prime_list = [True]*N m = int(N**0.5)+1 for i in range(3,m,2): if is_prime_list[i]: is_prime_list[i*i::2*i]=[False]*((N-i*i-1)//(2*i)+1) return [2] + [i for i in range(3,N,2) if is_prime_list[i]] n = int(input()) *a, = map(int,input().split()) primes = Eratosthenes(2000) z = {pi:i for i,pi in enumerate(primes)} v = [[] for _ in range(2001)] for p in primes: for j in range(p,2001,p): c = 0 jj = j while jj%p==0: jj //= p c += 1 #print(p,j) v[j].append((p,c)) L = len(primes) acc = [[0]*(n+1) for _ in range(L)] for i,ai in enumerate(a): for p,c in v[ai]: acc[z[p]][i] += c for i in range(L): for j in range(n)[::-1]: acc[i][j] += acc[i][j+1] Q = int(input()) for _ in range(Q): x,L,R = map(int,input().split()) for i,pi in enumerate(primes): c = 0 while x%pi==0: x //= pi c += 1 if c > acc[i][L-1] - acc[i][R]: print("NO") break else: print("Yes")