結果
| 問題 | 
                            No.1915 Addition 
                             | 
                    
| コンテスト | |
| ユーザー | 
                             tnodino
                         | 
                    
| 提出日時 | 2022-04-29 21:29:28 | 
| 言語 | Python3  (3.13.1 + numpy 2.2.1 + scipy 1.14.1)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 598 bytes | 
| コンパイル時間 | 94 ms | 
| コンパイル使用メモリ | 12,416 KB | 
| 実行使用メモリ | 10,752 KB | 
| 最終ジャッジ日時 | 2024-06-29 02:47:55 | 
| 合計ジャッジ時間 | 3,523 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge2 / judge1 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 1 | 
| other | WA * 10 | 
ソースコード
from math import sqrt
def PrimeFactorization(N):
    ret = []
    for i in range(2,int(sqrt(N))+1):
        while N % i == 0:
            ret.append(i)
            N //= i
    if N > 1:
        ret.append(N)
    return ret
def solve():
    N = int(input())
    ret = PrimeFactorization(N)
    M = len(ret)
    for bit in range(1<<M):
        b = bit
        x = 1
        for i in range(M):
            if b & 1:
                x *= ret[i]
            b >>= 1
        if int(str(N) + str(x)) % (N + x) == 0:
            print(x)
            return
T = int(input())
for _ in range(T):
    solve()
            
            
            
        
            
tnodino