結果
問題 | No.854 公平なりんご分配 |
ユーザー | maspy |
提出日時 | 2020-03-18 15:08:42 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,118 bytes |
コンパイル時間 | 385 ms |
コンパイル使用メモリ | 82,320 KB |
実行使用メモリ | 123,744 KB |
最終ジャッジ日時 | 2024-12-14 02:02:42 |
合計ジャッジ時間 | 43,879 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 44 ms
60,164 KB |
testcase_01 | AC | 45 ms
60,268 KB |
testcase_02 | AC | 46 ms
60,796 KB |
testcase_03 | AC | 48 ms
61,184 KB |
testcase_04 | AC | 44 ms
59,360 KB |
testcase_05 | AC | 47 ms
61,428 KB |
testcase_06 | AC | 46 ms
60,128 KB |
testcase_07 | AC | 46 ms
60,832 KB |
testcase_08 | AC | 49 ms
62,208 KB |
testcase_09 | AC | 49 ms
61,692 KB |
testcase_10 | AC | 51 ms
63,556 KB |
testcase_11 | AC | 49 ms
61,236 KB |
testcase_12 | AC | 51 ms
62,896 KB |
testcase_13 | AC | 51 ms
63,044 KB |
testcase_14 | AC | 47 ms
60,840 KB |
testcase_15 | AC | 50 ms
61,200 KB |
testcase_16 | AC | 53 ms
63,512 KB |
testcase_17 | AC | 49 ms
61,660 KB |
testcase_18 | AC | 49 ms
61,000 KB |
testcase_19 | AC | 51 ms
63,268 KB |
testcase_20 | AC | 48 ms
61,884 KB |
testcase_21 | AC | 49 ms
61,608 KB |
testcase_22 | AC | 66 ms
73,420 KB |
testcase_23 | AC | 58 ms
64,912 KB |
testcase_24 | AC | 71 ms
71,008 KB |
testcase_25 | AC | 56 ms
64,108 KB |
testcase_26 | AC | 67 ms
65,572 KB |
testcase_27 | AC | 63 ms
66,580 KB |
testcase_28 | AC | 61 ms
66,648 KB |
testcase_29 | AC | 54 ms
65,008 KB |
testcase_30 | AC | 57 ms
63,468 KB |
testcase_31 | AC | 72 ms
74,608 KB |
testcase_32 | AC | 256 ms
77,664 KB |
testcase_33 | AC | 280 ms
79,116 KB |
testcase_34 | AC | 476 ms
83,724 KB |
testcase_35 | AC | 336 ms
80,040 KB |
testcase_36 | AC | 235 ms
80,808 KB |
testcase_37 | AC | 219 ms
78,112 KB |
testcase_38 | AC | 227 ms
76,936 KB |
testcase_39 | AC | 659 ms
89,060 KB |
testcase_40 | AC | 281 ms
80,180 KB |
testcase_41 | AC | 315 ms
80,048 KB |
testcase_42 | AC | 433 ms
81,420 KB |
testcase_43 | AC | 488 ms
85,464 KB |
testcase_44 | AC | 389 ms
86,372 KB |
testcase_45 | AC | 477 ms
88,108 KB |
testcase_46 | AC | 600 ms
88,368 KB |
testcase_47 | AC | 286 ms
78,508 KB |
testcase_48 | AC | 406 ms
80,748 KB |
testcase_49 | AC | 352 ms
80,092 KB |
testcase_50 | AC | 238 ms
77,552 KB |
testcase_51 | AC | 495 ms
88,764 KB |
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 | WA | - |
testcase_83 | AC | 1,864 ms
122,424 KB |
testcase_84 | AC | 1,492 ms
122,236 KB |
testcase_85 | AC | 1,998 ms
122,452 KB |
testcase_86 | AC | 1,039 ms
123,744 KB |
testcase_87 | WA | - |
testcase_88 | WA | - |
testcase_89 | WA | - |
testcase_90 | WA | - |
testcase_91 | WA | - |
testcase_92 | AC | 1,687 ms
121,928 KB |
testcase_93 | AC | 2,146 ms
122,128 KB |
ソースコード
#!/usr/bin/env python3.8 # %% import sys read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines INF = 100 N = int(readline()) A = list(map(int, readline().split())) Q = int(readline()) m = map(int, read().split()) P, L, R = zip(*zip(m, m, m)) P = list(P) U = 2010 is_prime = [1] * U is_prime[0] = 0 is_prime[1] = 0 for p in range(2, U): if p * p >= U: break for i in range(p * p, U, p): is_prime[i] = 0 ok = [1] * Q ord_A = [0] * (N + 1) def solve(p): for i in range(N): e = 0 if not A[i]: e = 100 else: while A[i] % p == 0: A[i] //= p e += 1 ord_A[i + 1] = ord_A[i] + e for i in range(Q): e = 0 while P[i] % p == 0: P[i] //= p e += 1 f = ord_A[R[i]] - ord_A[L[i] - 1] if f < e: ok[i] = 0 for p in range(U): if is_prime[p]: solve(p) for i in range(Q): if P[i] > 1: ok[i] = 0 answers = ('Yes' if x else 'NO' for x in ok) print('\n'.join(answers))