結果
問題 | No.854 公平なりんご分配 |
ユーザー | ああいい |
提出日時 | 2022-03-04 19:02:09 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,297 bytes |
コンパイル時間 | 280 ms |
コンパイル使用メモリ | 82,336 KB |
実行使用メモリ | 98,312 KB |
最終ジャッジ日時 | 2024-07-18 16:03:54 |
合計ジャッジ時間 | 14,647 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 43 ms
58,624 KB |
testcase_01 | AC | 43 ms
58,364 KB |
testcase_02 | AC | 44 ms
58,880 KB |
testcase_03 | AC | 43 ms
58,624 KB |
testcase_04 | AC | 46 ms
58,368 KB |
testcase_05 | AC | 44 ms
58,624 KB |
testcase_06 | AC | 44 ms
58,496 KB |
testcase_07 | WA | - |
testcase_08 | AC | 45 ms
58,624 KB |
testcase_09 | AC | 44 ms
58,880 KB |
testcase_10 | AC | 44 ms
58,752 KB |
testcase_11 | WA | - |
testcase_12 | WA | - |
testcase_13 | WA | - |
testcase_14 | AC | 46 ms
58,624 KB |
testcase_15 | AC | 45 ms
58,880 KB |
testcase_16 | WA | - |
testcase_17 | WA | - |
testcase_18 | WA | - |
testcase_19 | WA | - |
testcase_20 | AC | 45 ms
58,608 KB |
testcase_21 | WA | - |
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 | AC | 167 ms
97,444 KB |
testcase_83 | WA | - |
testcase_84 | WA | - |
testcase_85 | AC | 277 ms
97,664 KB |
testcase_86 | AC | 156 ms
98,312 KB |
testcase_87 | AC | 185 ms
97,216 KB |
testcase_88 | AC | 192 ms
97,516 KB |
testcase_89 | AC | 191 ms
97,792 KB |
testcase_90 | AC | 187 ms
97,536 KB |
testcase_91 | AC | 190 ms
97,452 KB |
testcase_92 | WA | - |
testcase_93 | WA | - |
ソースコード
import sys rr = sys.stdin N = int(rr.readline()) A = list(map(int,rr.readline().split())) prime = [] dat = [0] * (2 * 10 ** 3) for i in range(2,2 * 10 ** 3): if dat[i] == 0: prime.append(i) for j in range(2 * i,2 * 10 ** 3): dat[j] = 1 n = len(prime) _sum = [[0] * n for _ in range(N+1)] bit = [0] * (N + 1) def add(i,x): while i <= N: bit[i] += x i += i & -i def fold(i): ans = 0 while i > 0: ans += bit[i] i -= i & -i return ans for i in range(N): if A[i] == 0: add(i+1,1) for j in range(n): _sum[i+1][j] = _sum[i][j] continue for j in range(n): p = prime[j] count = 0 while A[i] % p == 0: count += 1 A[i] //= p _sum[i+1][j] = _sum[i][j] + count Q = int(rr.readline()) for _ in range(Q): P,l,r = map(int,rr.readline().split()) if fold(r) - fold(l-1) > 0: print('Yes') continue flag = True for j in range(n): p = prime[j] count = 0 while P % p == 0: count += 1 P //= p if count > _sum[r][j] - _sum[l-1][j]: flag = False break if flag and P == 1: print('Yes') else: print('NO')