結果
問題 | No.854 公平なりんご分配 |
ユーザー | Navier_Boltzmann |
提出日時 | 2022-04-10 16:56:48 |
言語 | PyPy3 (7.3.15) |
結果 |
MLE
|
実行時間 | - |
コード長 | 1,966 bytes |
コンパイル時間 | 213 ms |
コンパイル使用メモリ | 82,396 KB |
実行使用メモリ | 848,468 KB |
最終ジャッジ日時 | 2024-05-08 04:39:48 |
合計ジャッジ時間 | 30,549 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 43 ms
64,044 KB |
testcase_01 | AC | 47 ms
63,408 KB |
testcase_02 | AC | 48 ms
64,212 KB |
testcase_03 | AC | 50 ms
65,796 KB |
testcase_04 | AC | 47 ms
63,696 KB |
testcase_05 | AC | 47 ms
65,324 KB |
testcase_06 | AC | 45 ms
63,632 KB |
testcase_07 | AC | 48 ms
63,580 KB |
testcase_08 | AC | 51 ms
64,224 KB |
testcase_09 | AC | 48 ms
64,864 KB |
testcase_10 | AC | 45 ms
64,128 KB |
testcase_11 | AC | 49 ms
64,736 KB |
testcase_12 | AC | 55 ms
66,640 KB |
testcase_13 | AC | 51 ms
67,672 KB |
testcase_14 | AC | 45 ms
64,672 KB |
testcase_15 | AC | 45 ms
64,832 KB |
testcase_16 | AC | 51 ms
67,432 KB |
testcase_17 | AC | 53 ms
67,280 KB |
testcase_18 | AC | 51 ms
66,472 KB |
testcase_19 | AC | 46 ms
65,936 KB |
testcase_20 | AC | 50 ms
65,368 KB |
testcase_21 | AC | 54 ms
64,544 KB |
testcase_22 | AC | 107 ms
77,760 KB |
testcase_23 | AC | 99 ms
78,796 KB |
testcase_24 | AC | 132 ms
79,816 KB |
testcase_25 | AC | 95 ms
78,400 KB |
testcase_26 | AC | 147 ms
79,864 KB |
testcase_27 | AC | 119 ms
79,880 KB |
testcase_28 | AC | 118 ms
77,892 KB |
testcase_29 | AC | 86 ms
77,588 KB |
testcase_30 | AC | 103 ms
78,140 KB |
testcase_31 | AC | 142 ms
79,556 KB |
testcase_32 | AC | 546 ms
128,936 KB |
testcase_33 | AC | 828 ms
106,508 KB |
testcase_34 | AC | 1,348 ms
149,680 KB |
testcase_35 | AC | 893 ms
134,092 KB |
testcase_36 | AC | 594 ms
82,972 KB |
testcase_37 | AC | 518 ms
125,536 KB |
testcase_38 | AC | 408 ms
115,696 KB |
testcase_39 | AC | 2,256 ms
156,392 KB |
testcase_40 | AC | 1,009 ms
102,816 KB |
testcase_41 | AC | 969 ms
123,084 KB |
testcase_42 | AC | 1,118 ms
147,964 KB |
testcase_43 | AC | 1,615 ms
126,924 KB |
testcase_44 | AC | 1,521 ms
144,444 KB |
testcase_45 | AC | 1,698 ms
94,908 KB |
testcase_46 | AC | 2,195 ms
145,028 KB |
testcase_47 | AC | 717 ms
113,360 KB |
testcase_48 | AC | 963 ms
146,780 KB |
testcase_49 | AC | 821 ms
148,352 KB |
testcase_50 | AC | 426 ms
125,096 KB |
testcase_51 | AC | 2,157 ms
148,132 KB |
testcase_52 | MLE | - |
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 | -- | - |
ソースコード
import pypyjit pypyjit.set_param('max_unroll_recursion=-1') import sys input = sys.stdin.buffer.readline N = int(input()) A = list(map(int,input().split())) Q = int(input()) from collections import defaultdict,Counter class prime_factorize(): def __init__(self,M=10**6): self.sieve = [-1]*(M+1) self.sieve[1] = 1 self.p = [False]*(M+1) for i in range(2,M+1): if self.sieve[i] == -1: self.p[i] = True for j in range(i,M+1,i): self.sieve[j] = i def factors(self,x): tmp = [] while self.sieve[x] != x: tmp.append(self.sieve[x]) x //= self.sieve[x] tmp.append(self.sieve[x]) return tmp def is_prime(self,x): return self.p[x] p = prime_factorize(M=2001) p_list = [] for i in range(1,2001): if p.is_prime(i): p_list.append(i) d = {i:[0]*N for i in p_list} for i in range(N): a = A[i] for k,v in Counter(p.factors(a)).items(): if k == 1: continue d[k][i] += v if i !=0: for k in p_list: d[k][i] += d[k][i-1] for _ in range(Q): P,L,R = map(int,input().split()) L -= 1 R -= 1 dp = {i:0 for i in p_list} c_flg = True while P != 1 and c_flg: flg = True for i in p_list: if P%i==0: dp[i] += 1 P //= i flg = False break if flg: print('NO') c_flg = False if not c_flg: continue if L != 0: if all(d[k][R]-d[k][L-1] >= dp[k] for k in dp.keys()): print('Yes') else: print('NO') continue else: if all(d[k][R] >= dp[k] for k in dp.keys()): print('Yes') else: print('NO') continue