結果
問題 | No.1262 グラフを作ろう! |
ユーザー | Kiri8128 |
提出日時 | 2020-10-17 14:22:47 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 2,723 ms / 3,000 ms |
コード長 | 668 bytes |
コンパイル時間 | 391 ms |
コンパイル使用メモリ | 82,232 KB |
実行使用メモリ | 296,564 KB |
最終ジャッジ日時 | 2024-07-21 02:21:44 |
合計ジャッジ時間 | 158,684 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 1,834 ms
205,696 KB |
testcase_01 | AC | 1,307 ms
162,600 KB |
testcase_02 | AC | 2,105 ms
233,424 KB |
testcase_03 | AC | 1,591 ms
175,724 KB |
testcase_04 | AC | 1,027 ms
191,140 KB |
testcase_05 | AC | 1,253 ms
181,224 KB |
testcase_06 | AC | 1,185 ms
212,688 KB |
testcase_07 | AC | 350 ms
100,192 KB |
testcase_08 | AC | 1,782 ms
226,064 KB |
testcase_09 | AC | 1,037 ms
154,472 KB |
testcase_10 | AC | 1,015 ms
148,412 KB |
testcase_11 | AC | 2,004 ms
240,752 KB |
testcase_12 | AC | 1,739 ms
194,236 KB |
testcase_13 | AC | 1,681 ms
178,584 KB |
testcase_14 | AC | 1,002 ms
153,704 KB |
testcase_15 | AC | 900 ms
141,604 KB |
testcase_16 | AC | 1,772 ms
219,272 KB |
testcase_17 | AC | 1,553 ms
194,500 KB |
testcase_18 | AC | 2,456 ms
248,252 KB |
testcase_19 | AC | 955 ms
177,316 KB |
testcase_20 | AC | 1,678 ms
233,100 KB |
testcase_21 | AC | 2,322 ms
236,704 KB |
testcase_22 | AC | 701 ms
169,176 KB |
testcase_23 | AC | 1,020 ms
149,084 KB |
testcase_24 | AC | 1,954 ms
225,052 KB |
testcase_25 | AC | 589 ms
134,704 KB |
testcase_26 | AC | 770 ms
145,184 KB |
testcase_27 | AC | 1,395 ms
210,012 KB |
testcase_28 | AC | 1,237 ms
189,752 KB |
testcase_29 | AC | 1,155 ms
185,768 KB |
testcase_30 | AC | 1,011 ms
155,824 KB |
testcase_31 | AC | 2,063 ms
212,688 KB |
testcase_32 | AC | 1,368 ms
173,204 KB |
testcase_33 | AC | 543 ms
104,872 KB |
testcase_34 | AC | 1,670 ms
235,740 KB |
testcase_35 | AC | 1,538 ms
179,892 KB |
testcase_36 | AC | 589 ms
111,348 KB |
testcase_37 | AC | 2,355 ms
253,504 KB |
testcase_38 | AC | 1,492 ms
198,664 KB |
testcase_39 | AC | 993 ms
147,568 KB |
testcase_40 | AC | 1,035 ms
146,248 KB |
testcase_41 | AC | 1,317 ms
198,440 KB |
testcase_42 | AC | 2,136 ms
248,836 KB |
testcase_43 | AC | 1,205 ms
182,004 KB |
testcase_44 | AC | 1,261 ms
175,476 KB |
testcase_45 | AC | 2,063 ms
242,336 KB |
testcase_46 | AC | 1,370 ms
219,396 KB |
testcase_47 | AC | 1,117 ms
152,136 KB |
testcase_48 | AC | 1,811 ms
219,456 KB |
testcase_49 | AC | 2,272 ms
246,728 KB |
testcase_50 | AC | 2,074 ms
244,052 KB |
testcase_51 | AC | 1,202 ms
160,276 KB |
testcase_52 | AC | 1,360 ms
210,084 KB |
testcase_53 | AC | 527 ms
115,084 KB |
testcase_54 | AC | 1,881 ms
199,944 KB |
testcase_55 | AC | 1,437 ms
174,512 KB |
testcase_56 | AC | 1,264 ms
191,880 KB |
testcase_57 | AC | 2,723 ms
276,972 KB |
testcase_58 | AC | 1,551 ms
186,044 KB |
testcase_59 | AC | 1,291 ms
199,544 KB |
testcase_60 | AC | 2,422 ms
264,192 KB |
testcase_61 | AC | 924 ms
148,852 KB |
testcase_62 | AC | 2,006 ms
232,432 KB |
testcase_63 | AC | 1,719 ms
193,780 KB |
testcase_64 | AC | 1,287 ms
167,692 KB |
testcase_65 | AC | 712 ms
144,940 KB |
testcase_66 | AC | 1,037 ms
155,124 KB |
testcase_67 | AC | 923 ms
155,988 KB |
testcase_68 | AC | 1,329 ms
218,756 KB |
testcase_69 | AC | 955 ms
160,156 KB |
testcase_70 | AC | 1,936 ms
245,664 KB |
testcase_71 | AC | 1,576 ms
205,364 KB |
testcase_72 | AC | 2,149 ms
264,076 KB |
testcase_73 | AC | 2,154 ms
247,444 KB |
testcase_74 | AC | 1,600 ms
216,716 KB |
testcase_75 | AC | 1,785 ms
223,900 KB |
testcase_76 | AC | 1,486 ms
201,060 KB |
testcase_77 | AC | 1,820 ms
222,908 KB |
testcase_78 | AC | 1,735 ms
217,624 KB |
testcase_79 | AC | 2,466 ms
270,352 KB |
testcase_80 | AC | 1,918 ms
247,164 KB |
testcase_81 | AC | 1,688 ms
218,844 KB |
testcase_82 | AC | 1,997 ms
236,128 KB |
testcase_83 | AC | 1,847 ms
237,912 KB |
testcase_84 | AC | 1,530 ms
203,696 KB |
testcase_85 | AC | 2,583 ms
275,912 KB |
testcase_86 | AC | 1,788 ms
232,608 KB |
testcase_87 | AC | 2,178 ms
258,312 KB |
testcase_88 | AC | 1,701 ms
218,320 KB |
testcase_89 | AC | 1,763 ms
229,580 KB |
testcase_90 | AC | 1,948 ms
294,568 KB |
testcase_91 | AC | 1,931 ms
294,824 KB |
testcase_92 | AC | 1,941 ms
294,548 KB |
testcase_93 | AC | 2,206 ms
296,564 KB |
testcase_94 | AC | 2,328 ms
295,232 KB |
testcase_95 | AC | 2,151 ms
295,428 KB |
ソースコード
from collections import Counter as C N, M = map(int, input().split()) A = [int(a) for a in input().split()] X = [-1] * (N+1) L = [[] for _ in range(N+1)] k = 2 while k <= N: X[k] = 1 L[k].append(k) for i in range(k*2, N+1, k): X[i] = 0 L[i].append(k) d = 2 while k**d <= N: for i in range(k**d, N+1, k**d): L[i].append(k) d += 1 while k <= N and X[k] >= 0: k += 1 P = [i for i in range(N+1) if X[i] == 1] def calc(n): s = 1 l = C(L[n]) for p in l: s = s * p ** (l[p] - 1) * ((p - 1) * (l[p] + 1) + 1) return s ans = - sum(A) for a in A: ans += calc(a) print(ans)