結果
問題 | No.1611 Minimum Multiple with Double Divisors |
ユーザー | lloyz |
提出日時 | 2021-12-31 01:06:40 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 560 ms / 2,000 ms |
コード長 | 1,108 bytes |
コンパイル時間 | 413 ms |
コンパイル使用メモリ | 82,668 KB |
実行使用メモリ | 78,296 KB |
最終ジャッジ日時 | 2024-10-07 04:50:25 |
合計ジャッジ時間 | 12,210 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 560 ms
77,012 KB |
testcase_01 | AC | 412 ms
77,136 KB |
testcase_02 | AC | 421 ms
76,952 KB |
testcase_03 | AC | 418 ms
77,132 KB |
testcase_04 | AC | 432 ms
77,220 KB |
testcase_05 | AC | 471 ms
77,120 KB |
testcase_06 | AC | 403 ms
77,176 KB |
testcase_07 | AC | 421 ms
77,144 KB |
testcase_08 | AC | 410 ms
77,068 KB |
testcase_09 | AC | 413 ms
76,992 KB |
testcase_10 | AC | 351 ms
77,004 KB |
testcase_11 | AC | 380 ms
77,220 KB |
testcase_12 | AC | 375 ms
78,048 KB |
testcase_13 | AC | 383 ms
78,296 KB |
testcase_14 | AC | 393 ms
78,136 KB |
testcase_15 | AC | 356 ms
77,440 KB |
testcase_16 | AC | 389 ms
77,524 KB |
testcase_17 | AC | 368 ms
77,696 KB |
testcase_18 | AC | 370 ms
77,184 KB |
testcase_19 | AC | 100 ms
77,368 KB |
testcase_20 | AC | 98 ms
77,056 KB |
testcase_21 | AC | 108 ms
77,076 KB |
testcase_22 | AC | 101 ms
76,896 KB |
testcase_23 | AC | 102 ms
77,112 KB |
testcase_24 | AC | 97 ms
77,388 KB |
testcase_25 | AC | 89 ms
76,784 KB |
testcase_26 | AC | 91 ms
77,056 KB |
testcase_27 | AC | 95 ms
77,184 KB |
testcase_28 | AC | 40 ms
54,144 KB |
testcase_29 | AC | 41 ms
53,888 KB |
testcase_30 | AC | 42 ms
54,144 KB |
testcase_31 | AC | 42 ms
54,016 KB |
testcase_32 | AC | 42 ms
54,144 KB |
testcase_33 | AC | 41 ms
53,888 KB |
testcase_34 | AC | 44 ms
53,760 KB |
testcase_35 | AC | 43 ms
53,888 KB |
testcase_36 | AC | 43 ms
53,888 KB |
testcase_37 | AC | 40 ms
53,888 KB |
testcase_38 | AC | 42 ms
54,144 KB |
ソースコード
from collections import defaultdict def prime_factorization(n): prime_cnt_dict = defaultdict(int) if n == 0 or n == 1: return prime_cnt_dict nc = n while nc % 2 == 0: nc //= 2 prime_cnt_dict[2] += 1 f = 3 while f * f <= n: cnt = 0 while nc % f == 0: nc //= f prime_cnt_dict[f] += 1 f += 2 if nc != 1: prime_cnt_dict[nc] = 1 return prime_cnt_dict Prime = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31] PrimeCountList = [prime_factorization(i) for i in range(32)] t = int(input()) for _ in range(t): x = int(input()) x_prime_cnt_dict = defaultdict(int) for prime in Prime: xc = x while xc % prime == 0: xc //= prime x_prime_cnt_dict[prime] += 1 for i in range(2, 32): x_cnt = 1 x_i_cnt = 1 for prime in PrimeCountList[i]: x_cnt *= x_prime_cnt_dict[prime] + 1 x_i_cnt *= x_prime_cnt_dict[prime] + PrimeCountList[i][prime] + 1 if 2 * x_cnt == x_i_cnt: break print(x * i)