結果
問題 | No.1611 Minimum Multiple with Double Divisors |
ユーザー | terasa |
提出日時 | 2022-06-15 22:12:40 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,650 bytes |
コンパイル時間 | 654 ms |
コンパイル使用メモリ | 82,540 KB |
実行使用メモリ | 78,368 KB |
最終ジャッジ日時 | 2024-10-04 22:24:49 |
合計ジャッジ時間 | 6,216 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 202 ms
77,808 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
63,636 KB |
testcase_29 | AC | 50 ms
63,508 KB |
testcase_30 | AC | 51 ms
63,236 KB |
testcase_31 | AC | 49 ms
62,988 KB |
testcase_32 | AC | 48 ms
64,280 KB |
testcase_33 | AC | 46 ms
63,288 KB |
testcase_34 | AC | 46 ms
62,904 KB |
testcase_35 | WA | - |
testcase_36 | AC | 49 ms
63,984 KB |
testcase_37 | AC | 51 ms
62,392 KB |
testcase_38 | AC | 49 ms
63,296 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 = 10 ** 30 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)