結果
問題 | No.1611 Minimum Multiple with Double Divisors |
ユーザー | NatsubiSogan |
提出日時 | 2021-08-14 12:37:51 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 910 ms / 2,000 ms |
コード長 | 1,344 bytes |
コンパイル時間 | 142 ms |
コンパイル使用メモリ | 82,208 KB |
実行使用メモリ | 78,492 KB |
最終ジャッジ日時 | 2024-10-05 03:57:33 |
合計ジャッジ時間 | 11,983 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 910 ms
78,156 KB |
testcase_01 | AC | 398 ms
77,484 KB |
testcase_02 | AC | 410 ms
77,584 KB |
testcase_03 | AC | 422 ms
77,812 KB |
testcase_04 | AC | 423 ms
78,356 KB |
testcase_05 | AC | 411 ms
78,204 KB |
testcase_06 | AC | 415 ms
77,496 KB |
testcase_07 | AC | 409 ms
77,628 KB |
testcase_08 | AC | 415 ms
77,752 KB |
testcase_09 | AC | 426 ms
77,548 KB |
testcase_10 | AC | 269 ms
78,324 KB |
testcase_11 | AC | 287 ms
78,296 KB |
testcase_12 | AC | 296 ms
78,492 KB |
testcase_13 | AC | 289 ms
78,412 KB |
testcase_14 | AC | 277 ms
78,020 KB |
testcase_15 | AC | 291 ms
78,060 KB |
testcase_16 | AC | 286 ms
77,832 KB |
testcase_17 | AC | 285 ms
78,064 KB |
testcase_18 | AC | 282 ms
77,820 KB |
testcase_19 | AC | 93 ms
77,108 KB |
testcase_20 | AC | 95 ms
77,492 KB |
testcase_21 | AC | 96 ms
77,308 KB |
testcase_22 | AC | 90 ms
77,172 KB |
testcase_23 | AC | 93 ms
77,036 KB |
testcase_24 | AC | 93 ms
77,064 KB |
testcase_25 | AC | 94 ms
77,120 KB |
testcase_26 | AC | 101 ms
77,268 KB |
testcase_27 | AC | 96 ms
77,556 KB |
testcase_28 | AC | 39 ms
54,652 KB |
testcase_29 | AC | 37 ms
54,928 KB |
testcase_30 | AC | 37 ms
54,984 KB |
testcase_31 | AC | 38 ms
54,424 KB |
testcase_32 | AC | 37 ms
54,772 KB |
testcase_33 | AC | 37 ms
55,692 KB |
testcase_34 | AC | 37 ms
54,920 KB |
testcase_35 | AC | 37 ms
55,260 KB |
testcase_36 | AC | 38 ms
54,852 KB |
testcase_37 | AC | 37 ms
54,196 KB |
testcase_38 | AC | 38 ms
54,568 KB |
ソースコード
from collections import Counter import math def prime_numbers(x): if x < 2: return [] prime_numbers = [i for i in range(x)] prime_numbers[1] = 0 for prime_number in prime_numbers: if prime_number > math.sqrt(x): break if prime_number == 0: continue for composite_number in range(2 * prime_number, x, prime_number): prime_numbers[composite_number] = 0 return [prime_number for prime_number in prime_numbers if prime_number != 0] primes = prime_numbers(33) def soinnsuu(x): s = [] for i in primes: if i > int(math.sqrt(x)): break elif x % i == 0: while x % i == 0: x //= i s.append(i) if not x == 1 and x in primes: s.append(x) return s def main(): import sys input = sys.stdin.buffer.readline d2 = [Counter(soinnsuu(i)) for i in range(33)] for _ in range(int(input())): x = int(input()) d = Counter(soinnsuu(x)) cnt = 1 for k, v in d.items(): cnt *= v + 1 for i in range(2, 32): cnt2 = 1 for k in primes: cnt2 *= d[k] + d2[i][k] + 1 if cnt2 == cnt * 2: print(i * x) break if __name__ == '__main__': main()