提出 #37945165


ソースコード 拡げる

MAX = int((9 * 10 ** 18) ** (1/3) + 1)

prime = [True] * (MAX + 1)

for i in range(2, MAX + 1):
    if not i: continue
    # prime[i * 2::i] = [False] * ((MAX - i * 2) // i + 1)
    for j in range(i * 2, MAX + 1, i):
        prime[j] = False

primes = [i for i in range(2, MAX + 1) if prime[i]]

def D(N):
    for p in primes:
        if N % p == 0:
            break
    
    a = N // p
    if a % p == 0:
        print(p, a // p)
    else:
        print(int(a ** (1/2)), p)
        
 
T = int(input())
for _ in range(T):
  D(int(input()))

提出情報

提出日時
問題 D - Happy New Year 2023
ユーザ arakaki_tokyo
言語 PyPy3 (7.3.0)
得点 400
コード長 566 Byte
結果 AC
実行時間 314 ms
メモリ 100644 KiB

ジャッジ結果

セット名 Sample All
得点 / 配点 0 / 0 400 / 400
結果
AC × 1
AC × 22
セット名 テストケース
Sample 00_sample_00.txt
All 00_sample_00.txt, 01_random_00.txt, 01_random_01.txt, 01_random_02.txt, 01_random_03.txt, 01_random_04.txt, 01_random_05.txt, 01_random_06.txt, 01_random_07.txt, 01_random_08.txt, 01_random_09.txt, 02_p_large_00.txt, 02_p_large_01.txt, 02_p_large_02.txt, 02_p_large_03.txt, 02_p_large_04.txt, 03_q_large_00.txt, 03_q_large_01.txt, 03_q_large_02.txt, 03_q_large_03.txt, 03_q_large_04.txt, 04_hand_00.txt
ケース名 結果 実行時間 メモリ
00_sample_00.txt AC 312 ms 100400 KiB
01_random_00.txt AC 306 ms 100544 KiB
01_random_01.txt AC 303 ms 100404 KiB
01_random_02.txt AC 314 ms 100272 KiB
01_random_03.txt AC 309 ms 100460 KiB
01_random_04.txt AC 309 ms 100492 KiB
01_random_05.txt AC 312 ms 100332 KiB
01_random_06.txt AC 307 ms 100524 KiB
01_random_07.txt AC 306 ms 100516 KiB
01_random_08.txt AC 308 ms 100520 KiB
01_random_09.txt AC 314 ms 100540 KiB
02_p_large_00.txt AC 303 ms 100368 KiB
02_p_large_01.txt AC 303 ms 100228 KiB
02_p_large_02.txt AC 308 ms 100644 KiB
02_p_large_03.txt AC 299 ms 100232 KiB
02_p_large_04.txt AC 297 ms 100372 KiB
03_q_large_00.txt AC 295 ms 100180 KiB
03_q_large_01.txt AC 303 ms 100500 KiB
03_q_large_02.txt AC 300 ms 100412 KiB
03_q_large_03.txt AC 302 ms 100500 KiB
03_q_large_04.txt AC 299 ms 100500 KiB
04_hand_00.txt AC 301 ms 100412 KiB