結果
問題 | No.1611 Minimum Multiple with Double Divisors |
ユーザー | terasa |
提出日時 | 2022-06-15 22:10:32 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,649 bytes |
コンパイル時間 | 336 ms |
コンパイル使用メモリ | 82,104 KB |
実行使用メモリ | 78,648 KB |
最終ジャッジ日時 | 2024-10-04 22:20:23 |
合計ジャッジ時間 | 6,435 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 192 ms
77,264 KB |
testcase_01 | WA | - |
testcase_02 | WA | - |
testcase_03 | WA | - |
testcase_04 | WA | - |
testcase_05 | WA | - |
testcase_06 | WA | - |
testcase_07 | WA | - |
testcase_08 | WA | - |
testcase_09 | WA | - |
testcase_10 | WA | - |
testcase_11 | WA | - |
testcase_12 | WA | - |
testcase_13 | WA | - |
testcase_14 | WA | - |
testcase_15 | WA | - |
testcase_16 | WA | - |
testcase_17 | WA | - |
testcase_18 | WA | - |
testcase_19 | WA | - |
testcase_20 | WA | - |
testcase_21 | WA | - |
testcase_22 | WA | - |
testcase_23 | WA | - |
testcase_24 | WA | - |
testcase_25 | WA | - |
testcase_26 | WA | - |
testcase_27 | WA | - |
testcase_28 | AC | 48 ms
62,460 KB |
testcase_29 | AC | 50 ms
62,600 KB |
testcase_30 | AC | 47 ms
63,532 KB |
testcase_31 | AC | 48 ms
63,248 KB |
testcase_32 | AC | 49 ms
62,828 KB |
testcase_33 | AC | 51 ms
63,772 KB |
testcase_34 | AC | 49 ms
62,944 KB |
testcase_35 | WA | - |
testcase_36 | AC | 52 ms
63,196 KB |
testcase_37 | AC | 53 ms
62,756 KB |
testcase_38 | AC | 49 ms
63,200 KB |
ソースコード
import sys import pypyjit import itertools import heapq import math from collections import deque, defaultdict import bisect input = sys.stdin.readline sys.setrecursionlimit(10 ** 6) pypyjit.set_param('max_unroll_recursion=-1') def index_lt(a, x): 'return largest index s.t. A[i] < x or -1 if it does not exist' return bisect.bisect_left(a, x) - 1 def index_le(a, x): 'return largest index s.t. A[i] <= x or -1 if it does not exist' return bisect.bisect_right(a, x) - 1 def index_gt(a, x): 'return smallest index s.t. A[i] > x or len(a) if it does not exist' return bisect.bisect_right(a, x) def index_ge(a, x): 'return smallest index s.t. A[i] >= x or len(a) if it does not exist' return bisect.bisect_left(a, x) class PrimeTable: def __init__(self, N): self.is_prime = [True] * (N + 1) self.is_prime[0] = False self.is_prime[1] = False for i in range(2, N + 1): if i * i > N: break if self.is_prime[i] is False: continue for j in range(2, N + 1): if i * j > N: break self.is_prime[i * j] = False self.primes = [n for n in range(2, N + 1) if self.is_prime[n]] def is_prime(self, n): return self.is_prime[n] primes = PrimeTable(10 ** 5).primes T = int(input()) for _ in range(T): X = int(input()) a = 1 << 40 for p in primes: if a <= p: break x = X cnt = 0 while x % p == 0: x //= p cnt += 1 a = min(a, pow(p, cnt + 1)) print(X * a)